add permission brother

This commit is contained in:
mamoss 2025-12-12 01:36:51 +07:00
parent 878e52b1b0
commit 3a4e16deb0
5 changed files with 35 additions and 21 deletions

View file

@ -79,7 +79,7 @@ export class OrganizationDotnetController extends Controller {
) {
let condition = "1=1";
let conditionParams = {};
if (body.role === "CHILD") {
if (body.role === "CHILD" || body.role === "BROTHER") {
switch (body.node) {
case 0:
condition = "orgRoot.ancestorDNA = :nodeId";
@ -198,7 +198,7 @@ export class OrganizationDotnetController extends Controller {
) {
let condition = "1=1";
let conditionParams = {};
if (body.role === "CHILD") {
if (body.role === "CHILD" || body.role === "BROTHER") {
switch (body.node) {
case 0:
condition = "orgRoot.ancestorDNA = :nodeId";
@ -4399,8 +4399,8 @@ export class OrganizationDotnetController extends Controller {
},
) {
let typeCondition: any = {};
if (body.role === "CHILD" || body.role === "PARENT") {
if (body.role === "CHILD") {
if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") {
if (body.role === "CHILD" || body.role === "BROTHER") {
switch (body.node) {
case 0:
typeCondition = {
@ -4441,16 +4441,14 @@ export class OrganizationDotnetController extends Controller {
typeCondition = {};
break;
}
}
else if (body.role === "PARENT") {
} else if (body.role === "PARENT") {
typeCondition = {
orgRoot: {
ancestorDNA: body.nodeId
ancestorDNA: body.nodeId,
},
orgChild1: Not(IsNull()),
};
}
} else if (body.role === "OWNER" || body.role === "ROOT") {
switch (body.reqNode) {
case 0:
@ -5005,8 +5003,8 @@ export class OrganizationDotnetController extends Controller {
},
) {
let typeCondition: any = {};
if (body.role === "CHILD" || body.role === "PARENT") {
if (body.role === "CHILD") {
if (body.role === "CHILD" || body.role === "PARENT" || body.role === "BROTHER") {
if (body.role === "CHILD" || body.role === "BROTHER") {
switch (body.node) {
case 0:
typeCondition = {
@ -5043,23 +5041,18 @@ export class OrganizationDotnetController extends Controller {
},
};
break;
case null:
typeCondition = {};
break;
default:
typeCondition = {};
break;
}
}
else if (body.role === "PARENT") {
} else if (body.role === "PARENT") {
typeCondition = {
orgRoot: {
ancestorDNA: body.nodeId
ancestorDNA: body.nodeId,
},
orgChild1: Not(IsNull()),
};
}
} else if (body.role === "OWNER" || body.role === "ROOT") {
switch (body.reqNode) {
case 0: