ปรับเงื่อนไข admin ให้เห็นข้อมูลทั้งสังกัด (#186)
This commit is contained in:
parent
564d7d96c3
commit
e0e850b4c7
1 changed files with 3 additions and 43 deletions
|
|
@ -499,49 +499,9 @@ export class KeycloakController extends Controller {
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (
|
||||
profile?.current_holders[0]?.orgRootId &&
|
||||
profile?.current_holders[0]?.orgChild1Id == null
|
||||
) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'
|
||||
and current_holders.orgChild1Id IS NULL
|
||||
and current_holders.orgChild2Id IS NULL
|
||||
and current_holders.orgChild3Id IS NULL
|
||||
and current_holders.orgChild4Id IS NULL`;
|
||||
} else if (
|
||||
profile?.current_holders[0]?.orgChild1Id &&
|
||||
profile?.current_holders[0]?.orgChild2Id == null
|
||||
) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'
|
||||
and current_holders.orgChild1Id = '${profile?.current_holders[0]?.orgChild1Id}'
|
||||
and current_holders.orgChild2Id IS NULL
|
||||
and current_holders.orgChild3Id IS NULL
|
||||
and current_holders.orgChild4Id IS NULL`;
|
||||
} else if (
|
||||
profile?.current_holders[0]?.orgChild2Id &&
|
||||
profile?.current_holders[0]?.orgChild3Id == null
|
||||
) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'
|
||||
and current_holders.orgChild1Id = '${profile?.current_holders[0]?.orgChild1Id}'
|
||||
and current_holders.orgChild2Id = '${profile?.current_holders[0]?.orgChild2Id}'
|
||||
and current_holders.orgChild3Id IS NULL
|
||||
and current_holders.orgChild4Id IS NULL`;
|
||||
} else if (
|
||||
profile?.current_holders[0]?.orgChild3Id &&
|
||||
profile?.current_holders[0]?.orgChild4Id == null
|
||||
) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'
|
||||
and current_holders.orgChild1Id = '${profile?.current_holders[0]?.orgChild1Id}'
|
||||
and current_holders.orgChild2Id = '${profile?.current_holders[0]?.orgChild2Id}'
|
||||
and current_holders.orgChild3Id = '${profile?.current_holders[0]?.orgChild3Id}'
|
||||
and current_holders.orgChild4Id IS NULL`;
|
||||
} else if (profile?.current_holders[0]?.orgChild4Id) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'
|
||||
and current_holders.orgChild1Id = '${profile?.current_holders[0]?.orgChild1Id}'
|
||||
and current_holders.orgChild2Id = '${profile?.current_holders[0]?.orgChild2Id}'
|
||||
and current_holders.orgChild3Id = '${profile?.current_holders[0]?.orgChild3Id}'
|
||||
and current_holders.orgChild4Id = '${profile?.current_holders[0]?.orgChild4Id}'`;
|
||||
//ADMIN เห็นทั้งหน่วยงานที่สังกัด
|
||||
if (profile?.current_holders[0]?.orgRootId) {
|
||||
checkChildFromRole = `current_holders.orgRootId = '${profile?.current_holders[0]?.orgRootId}'`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue