เช็คสิทธิ์
This commit is contained in:
parent
0d3e502513
commit
edad154826
1 changed files with 14 additions and 15 deletions
|
|
@ -138,11 +138,11 @@ class CheckAuth {
|
||||||
.GetData(req, `/org/permission/user/${profileId}`)
|
.GetData(req, `/org/permission/user/${profileId}`)
|
||||||
.then(async (x) => {
|
.then(async (x) => {
|
||||||
let org = {
|
let org = {
|
||||||
orgRootId: [null],
|
root: [null],
|
||||||
orgChild1Id: [null],
|
child1: [null],
|
||||||
orgChild2Id: [null],
|
child2: [null],
|
||||||
orgChild3Id: [null],
|
child3: [null],
|
||||||
orgChild4Id: [null],
|
child4: [null],
|
||||||
};
|
};
|
||||||
if (action.trim().toLocaleUpperCase() == "CREATE")
|
if (action.trim().toLocaleUpperCase() == "CREATE")
|
||||||
org = await this.PermissionOrgCreate(req, system);
|
org = await this.PermissionOrgCreate(req, system);
|
||||||
|
|
@ -155,16 +155,15 @@ class CheckAuth {
|
||||||
if (action.trim().toLocaleUpperCase() == "UPDATE")
|
if (action.trim().toLocaleUpperCase() == "UPDATE")
|
||||||
org = await this.PermissionOrgUpdate(req, system);
|
org = await this.PermissionOrgUpdate(req, system);
|
||||||
|
|
||||||
if (org.orgRootId != null)
|
if (org.root != null) if (x.orgRootId != org.root[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (x.orgRootId != org.orgRootId[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
if (org.child1 != null)
|
||||||
if (org.orgChild1Id != null)
|
if (x.orgChild1Id != org.child1[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (x.orgChild1Id != org.orgChild1Id[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
if (org.child2 != null)
|
||||||
if (org.orgChild2Id != null)
|
if (x.orgChild2Id != org.child2[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (x.orgChild2Id != org.orgChild2Id[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
if (org.child3 != null)
|
||||||
if (org.orgChild3Id != null)
|
if (x.orgChild3Id != org.child3[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (x.orgChild3Id != org.orgChild3Id[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
if (org.child4 != null)
|
||||||
if (org.orgChild4Id != null)
|
if (x.orgChild4Id != org.child4[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (x.orgChild4Id != org.orgChild4Id[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue