role.entity.ts 689 B

123456789101112131415161718192021222324
  1. import { Permission } from 'shared/generated-types';
  2. import { DeepPartial } from 'shared/shared-types';
  3. import { Column, Entity, JoinTable, ManyToMany } from 'typeorm';
  4. import { ChannelAware } from '../../common/types/common-types';
  5. import { VendureEntity } from '../base/base.entity';
  6. import { Channel } from '../channel/channel.entity';
  7. @Entity()
  8. export class Role extends VendureEntity implements ChannelAware {
  9. constructor(input?: DeepPartial<Role>) {
  10. super(input);
  11. }
  12. @Column() code: string;
  13. @Column() description: string;
  14. @Column('simple-array') permissions: Permission[];
  15. @ManyToMany(type => Channel)
  16. @JoinTable()
  17. channels: Channel[];
  18. }