mirror of https://github.com/portainer/portainer
fix(menu): edge compute menu not clickable EE-6804 (#11320)
parent
b5f839a920
commit
0ea21f2317
|
@ -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…
Reference in New Issue