feat(core): Add LDAP support (#3835)
This commit is contained in:
@@ -38,6 +38,7 @@ import { useUIStore } from './ui';
|
||||
|
||||
const isDefaultUser = (user: IUserResponse | null) =>
|
||||
Boolean(user && user.isPending && user.globalRole && user.globalRole.name === ROLE.Owner);
|
||||
|
||||
const isPendingUser = (user: IUserResponse | null) => Boolean(user && user.isPending);
|
||||
|
||||
export const useUsersStore = defineStore(STORES.USERS, {
|
||||
@@ -58,8 +59,8 @@ export const useUsersStore = defineStore(STORES.USERS, {
|
||||
getUserById(state) {
|
||||
return (userId: string): IUser | null => state.users[userId];
|
||||
},
|
||||
globalRoleName(): string {
|
||||
return this.currentUser?.globalRole?.name || '';
|
||||
globalRoleName(): IRole {
|
||||
return this.currentUser?.globalRole?.name ?? 'default';
|
||||
},
|
||||
canUserDeleteTags(): boolean {
|
||||
return isAuthorized(PERMISSIONS.TAGS.CAN_DELETE_TAGS, this.currentUser);
|
||||
@@ -116,7 +117,7 @@ export const useUsersStore = defineStore(STORES.USERS, {
|
||||
: undefined,
|
||||
isDefaultUser: isDefaultUser(updatedUser),
|
||||
isPendingUser: isPendingUser(updatedUser),
|
||||
isOwner: Boolean(updatedUser.globalRole && updatedUser.globalRole.name === ROLE.Owner),
|
||||
isOwner: updatedUser.globalRole?.name === ROLE.Owner,
|
||||
};
|
||||
Vue.set(this.users, user.id, user);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user