fix(menu): edge compute menu not clickable EE-6804 (#11319)

pull/11332/head
cmeng 9 months ago committed by GitHub
parent 8dfa5efa71
commit 21d67a971d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -62,7 +62,7 @@ export async function checkAuthorizations(transition: Transition) {
} }
if (access === 'edge-admin') { if (access === 'edge-admin') {
if (authService.isAdmin()) { if (authService.isAdmin(true)) {
return undefined; return undefined;
} }

@ -133,16 +133,16 @@ angular.module('portainer.app').factory('Authentication', [
// To avoid creating divergence between CE and EE // To avoid creating divergence between CE and EE
// isAdmin checks if the user is a portainer admin or edge admin // isAdmin checks if the user is a portainer admin or edge admin
function isEdgeAdmin() { function isEdgeAdmin(noEnvScope = false) {
const environment = EndpointProvider.currentEndpoint(); const environment = EndpointProvider.currentEndpoint();
return userHelpers.isEdgeAdmin({ Role: user.role }, environment); return userHelpers.isEdgeAdmin({ Role: user.role }, noEnvScope ? undefined : environment);
} }
/** /**
* @deprecated use Authentication.isAdmin instead * @deprecated use Authentication.isAdmin instead
*/ */
function isAdmin() { function isAdmin(noEnvScope = false) {
return isEdgeAdmin(); return isEdgeAdmin(noEnvScope);
} }
// To avoid creating divergence between CE and EE // To avoid creating divergence between CE and EE

@ -10,7 +10,7 @@ export interface StateManager {
export interface IAuthenticationService { export interface IAuthenticationService {
getUserDetails(): { ID: number }; getUserDetails(): { ID: number };
isAuthenticated(): boolean; isAuthenticated(): boolean;
isAdmin(): boolean; isAdmin(noEnvScope?: boolean): boolean;
isPureAdmin(): boolean; isPureAdmin(): boolean;
hasAuthorizations(authorizations: string[]): boolean; hasAuthorizations(authorizations: string[]): boolean;

Loading…
Cancel
Save