mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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 = {
 | 
					    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',
 | 
					        variant: 'warning',
 | 
				
			||||||
        link: 'dialog',
 | 
					        link: 'dialog',
 | 
				
			||||||
        linkText: 'Please update those versions',
 | 
					        linkText: 'Please update those versions',
 | 
				
			||||||
 | 
				
			|||||||
@ -41,11 +41,13 @@ import BadDataError from '../error/bad-data-error';
 | 
				
			|||||||
import type { IGroup } from '../types/group';
 | 
					import type { IGroup } from '../types/group';
 | 
				
			||||||
import type { GroupService } from './group-service';
 | 
					import type { GroupService } from './group-service';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
 | 
					    ADMIN_TOKEN_USER,
 | 
				
			||||||
    type IUnleashConfig,
 | 
					    type IUnleashConfig,
 | 
				
			||||||
    type IUserAccessOverview,
 | 
					    type IUserAccessOverview,
 | 
				
			||||||
    RoleCreatedEvent,
 | 
					    RoleCreatedEvent,
 | 
				
			||||||
    RoleDeletedEvent,
 | 
					    RoleDeletedEvent,
 | 
				
			||||||
    RoleUpdatedEvent,
 | 
					    RoleUpdatedEvent,
 | 
				
			||||||
 | 
					    SYSTEM_USER_ID,
 | 
				
			||||||
} from '../types';
 | 
					} from '../types';
 | 
				
			||||||
import type EventService from '../features/events/event-service';
 | 
					import type EventService from '../features/events/event-service';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -889,6 +891,9 @@ export class AccessService {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async isRootAdmin(userId: number): Promise<boolean> {
 | 
					    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);
 | 
					        const roles = await this.store.getRolesForUserId(userId);
 | 
				
			||||||
        return roles.some(
 | 
					        return roles.some(
 | 
				
			||||||
            (role) => role.name.toLowerCase() === ADMIN.toLowerCase(),
 | 
					            (role) => role.name.toLowerCase() === ADMIN.toLowerCase(),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user