feat: add more role to each endpoint
This commit is contained in:
parent
500e5a8fbe
commit
8e18546b44
3 changed files with 10 additions and 10 deletions
|
|
@ -128,7 +128,7 @@ export class ProductGroup extends Controller {
|
|||
}
|
||||
|
||||
@Post()
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "accountant"])
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "branch_accountant", "accountant"])
|
||||
async createProductGroup(@Request() req: RequestWithUser, @Body() body: ProductGroupCreate) {
|
||||
const record = await prisma.$transaction(
|
||||
async (tx) => {
|
||||
|
|
@ -166,7 +166,7 @@ export class ProductGroup extends Controller {
|
|||
}
|
||||
|
||||
@Put("{groupId}")
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "accountant"])
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "branch_accountant", "accountant"])
|
||||
async editProductGroup(
|
||||
@Request() req: RequestWithUser,
|
||||
@Body() body: ProductGroupUpdate,
|
||||
|
|
@ -193,7 +193,7 @@ export class ProductGroup extends Controller {
|
|||
}
|
||||
|
||||
@Delete("{groupId}")
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "accountant"])
|
||||
@Security("keycloak", ["system", "head_of_admin", "admin", "branch_accountant", "accountant"])
|
||||
async deleteProductGroup(@Path() groupId: string) {
|
||||
const record = await prisma.productGroup.findFirst({ where: { id: groupId } });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue