Merge branch 'develop' into develop-Bright

This commit is contained in:
Bright 2024-06-12 10:25:51 +07:00
commit 7bb199d254
2 changed files with 17 additions and 2 deletions

View file

@ -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 });
}

View file

@ -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<CreateAuthRoleAttr>;