fix: not all user return when pass responsibleDistrictArea
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 15s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 15s
This commit is contained in:
parent
afca10983d
commit
d961ab086b
1 changed files with 4 additions and 1 deletions
|
|
@ -178,6 +178,7 @@ type UserUpdate = {
|
||||||
branchId?: string | string[];
|
branchId?: string | string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const permissionCondCompany = createPermCondition((_) => true);
|
||||||
const permissionCond = createPermCondition(globalAllow);
|
const permissionCond = createPermCondition(globalAllow);
|
||||||
const permissionCheck = createPermCheck(globalAllow);
|
const permissionCheck = createPermCheck(globalAllow);
|
||||||
|
|
||||||
|
|
@ -348,7 +349,9 @@ export class UserController extends Controller {
|
||||||
: {
|
: {
|
||||||
some: {
|
some: {
|
||||||
branch: {
|
branch: {
|
||||||
OR: permissionCond(req.user, { activeOnly: activeBranchOnly }),
|
OR: responsibleDistrictId
|
||||||
|
? permissionCondCompany(req.user, { activeOnly: activeBranchOnly }) // NOTE: when pass responsibleDistrictId should see all user not only to current branch
|
||||||
|
: permissionCond(req.user, { activeOnly: activeBranchOnly }),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue