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;
|
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const permissionCondCompany = createPermCondition((_) => true);
|
||||||
const permissionCond = createPermCondition(globalAllow);
|
const permissionCond = createPermCondition(globalAllow);
|
||||||
|
const permissionCheckCompany = createPermCheck((_) => true);
|
||||||
const permissionCheck = createPermCheck(globalAllow);
|
const permissionCheck = createPermCheck(globalAllow);
|
||||||
|
|
||||||
type EmployeeCreate = {
|
type EmployeeCreate = {
|
||||||
|
|
@ -669,7 +671,7 @@ export class EmployeeFileController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!data) throw notFoundError("Employee");
|
if (!data) throw notFoundError("Employee");
|
||||||
await permissionCheck(user, data.customerBranch.customer.registeredBranch);
|
await permissionCheckCompany(user, data.customerBranch.customer.registeredBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("image")
|
@Get("image")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue