mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: small improvements (#7090)
Fixing isAdmin method. It is not that critical, because that is mostly for system users not real usage. Also fixing wording for outdated sdks.
This commit is contained in:
parent
45c75a65ce
commit
4f46f03843
@ -36,7 +36,7 @@ export const OutdatedSdksBanner = ({ project }: IOutdatedSdksBannerProps) => {
|
||||
};
|
||||
|
||||
const outdatedSdksBanner: IBanner = {
|
||||
message: `We noticed that an outdated SDK version is connected to this Unleash instance.`,
|
||||
message: `We noticed that an outdated SDK version is connected to ${project} project.`,
|
||||
variant: 'warning',
|
||||
link: 'dialog',
|
||||
linkText: 'Please update those versions',
|
||||
|
@ -41,11 +41,13 @@ import BadDataError from '../error/bad-data-error';
|
||||
import type { IGroup } from '../types/group';
|
||||
import type { GroupService } from './group-service';
|
||||
import {
|
||||
ADMIN_TOKEN_USER,
|
||||
type IUnleashConfig,
|
||||
type IUserAccessOverview,
|
||||
RoleCreatedEvent,
|
||||
RoleDeletedEvent,
|
||||
RoleUpdatedEvent,
|
||||
SYSTEM_USER_ID,
|
||||
} from '../types';
|
||||
import type EventService from '../features/events/event-service';
|
||||
|
||||
@ -889,6 +891,9 @@ export class AccessService {
|
||||
}
|
||||
|
||||
async isRootAdmin(userId: number): Promise<boolean> {
|
||||
if (userId === SYSTEM_USER_ID || userId === ADMIN_TOKEN_USER.id) {
|
||||
return true;
|
||||
}
|
||||
const roles = await this.store.getRolesForUserId(userId);
|
||||
return roles.some(
|
||||
(role) => role.name.toLowerCase() === ADMIN.toLowerCase(),
|
||||
|
Loading…
Reference in New Issue
Block a user