Enhance SUPER_ADMIN middleware and permission utility for improved access control
- Updated the `requireSuperAdmin` middleware to allow users with `userType` as 'SUPER_ADMIN' to access management functionalities, even if their `companyCode` is not '*'. - Modified the `isSuperAdmin` utility function to recognize users as SUPER_ADMIN based solely on their `userType`, simplifying the access validation logic. - These changes ensure that SUPER_ADMIN users maintain their management capabilities across company transitions, enhancing the flexibility and security of the application.
This commit is contained in:
@@ -21,7 +21,8 @@ export enum PermissionLevel {
|
||||
*/
|
||||
export function isSuperAdmin(user?: PersonBean | null): boolean {
|
||||
if (!user) return false;
|
||||
return user.companyCode === "*" && user.userType === "SUPER_ADMIN";
|
||||
// 회사전환 후에도 userType이 SUPER_ADMIN이면 최고관리자로 인정
|
||||
return user.userType === "SUPER_ADMIN";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user