fix: permission employee
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
This commit is contained in:
parent
df38eebbcc
commit
2c9fae400c
1 changed files with 3 additions and 1 deletions
|
|
@ -65,7 +65,9 @@ function globalAllow(user: RequestWithUser["user"]) {
|
|||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||
}
|
||||
|
||||
const permissionCondCompany = createPermCondition((_) => true);
|
||||
const permissionCond = createPermCondition(globalAllow);
|
||||
const permissionCheckCompany = createPermCheck((_) => true);
|
||||
const permissionCheck = createPermCheck(globalAllow);
|
||||
|
||||
type EmployeeCreate = {
|
||||
|
|
@ -669,7 +671,7 @@ export class EmployeeFileController extends Controller {
|
|||
},
|
||||
});
|
||||
if (!data) throw notFoundError("Employee");
|
||||
await permissionCheck(user, data.customerBranch.customer.registeredBranch);
|
||||
await permissionCheckCompany(user, data.customerBranch.customer.registeredBranch);
|
||||
}
|
||||
|
||||
@Get("image")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue