diff --git a/src/controllers/AuthRoleController.ts b/src/controllers/AuthRoleController.ts index 361a55f7..e747ec9f 100644 --- a/src/controllers/AuthRoleController.ts +++ b/src/controllers/AuthRoleController.ts @@ -81,7 +81,8 @@ export class AuthRoleController extends Controller { roleName: string; roleDescription: string; authRoleAttrs: Array<{ - id: string; + // id: string; + authSysId: string; attrOwnership: string; attrIsCreate: boolean; attrIsList: boolean; @@ -89,6 +90,7 @@ export class AuthRoleController extends Controller { attrIsUpdate: boolean; attrIsDelete: boolean; attrPrivilege: string; + parentNode: string; }>; }, ) { @@ -99,6 +101,8 @@ export class AuthRoleController extends Controller { ...attr, attrOwnership: attr.attrOwnership.toUpperCase(), attrPrivilege: attr.attrPrivilege.toUpperCase(), + authSysId: attr.authSysId.toUpperCase(), + parentNode: attr.parentNode.toUpperCase(), })); Object.assign(record, { @@ -112,7 +116,7 @@ export class AuthRoleController extends Controller { }); const updatedRoleAttrData = roleAttrData.map((attr) => { - const updatedAttr = body.authRoleAttrs.find((a) => a.id === attr.id); + const updatedAttr = body.authRoleAttrs.find((a) => a.authSysId === attr.authSysId); if (updatedAttr) { return Object.assign(attr, updatedAttr, { lastUpdateFullName: req.user.name }); } diff --git a/src/entities/AuthRoleAttr.ts b/src/entities/AuthRoleAttr.ts index 0ee8a618..401c5d76 100644 --- a/src/entities/AuthRoleAttr.ts +++ b/src/entities/AuthRoleAttr.ts @@ -67,6 +67,14 @@ export class AuthRoleAttr extends EntityBase { }) authSysId: string; + @Column({ + nullable: true, + length: 255, + comment: "Root", + default: null, + }) + parentNode?: string | null; + @ManyToOne(() => AuthSys, (authSys) => authSys.authSys) @JoinColumn({ name: "authSysId" }) authRoleAttrForSys: AuthSys; @@ -103,6 +111,9 @@ export class CreateAuthRoleAttr { @Column("uuid") authSysId: string; + + @Column() + parentNode?: string | null; } export type UpdateAuthRoleAttr = Partial;