Skip to content

Instantly share code, notes, and snippets.

@ktutnik
Created May 3, 2021 03:28
Show Gist options
  • Save ktutnik/551a66c0d274585e55ec57625bde8ece to your computer and use it in GitHub Desktop.
Save ktutnik/551a66c0d274585e55ec57625bde8ece to your computer and use it in GitHub Desktop.
@genericController(c => {
c.mutators().authorize("ShopOwner", "Staff")
})
@Entity()
export class Product {
@PrimaryGeneratedColumn()
id: number;
@val.required()
@Column()
name: string;
@authorize.read("ShopOwner", "Staff")
@Column()
basePrice: number;
@authorize.write("ShopOwner")
@Column()
price: number;
@authorize.readonly()
@CreateDateColumn()
createdOn:Date
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment