owner privilege

This commit is contained in:
Adisak 2025-10-22 11:59:49 +07:00
parent ad3a04ad3f
commit 04484444ec

View file

@ -6145,6 +6145,7 @@ export class OrganizationController extends Controller {
// กำหนดการเข้าถึงข้อมูลตามสถานะและสิทธิ์ // กำหนดการเข้าถึงข้อมูลตามสถานะและสิทธิ์
const isCurrentActive = !orgRevision.orgRevisionIsDraft && orgRevision.orgRevisionIsCurrent; const isCurrentActive = !orgRevision.orgRevisionIsDraft && orgRevision.orgRevisionIsCurrent;
if (isCurrentActive) { if (isCurrentActive) {
if(_privilege.privilege !== "OWNER"){
if(_privilege.privilege == "NORMAL"){ if(_privilege.privilege == "NORMAL"){
const holder = profile.current_holders.find(x => x.orgRevisionId === id); const holder = profile.current_holders.find(x => x.orgRevisionId === id);
if (!holder) return; if (!holder) return;
@ -6172,6 +6173,9 @@ export class OrganizationController extends Controller {
}else{ }else{
_data.root = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgRootId]; _data.root = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgRootId];
} }
} else {
if (!attrOwnership) _data = _privilege;
}
} }
const orgRootData = await AppDataSource.getRepository(OrgRoot) const orgRootData = await AppDataSource.getRepository(OrgRoot)