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 (authService.isAdmin()) {
|
||||
if (authService.isAdmin(true)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,16 +133,16 @@ angular.module('portainer.app').factory('Authentication', [
|
|||
// To avoid creating divergence between CE and EE
|
||||
// isAdmin checks if the user is a portainer admin or edge admin
|
||||
|
||||
function isEdgeAdmin() {
|
||||
function isEdgeAdmin(noEnvScope = false) {
|
||||
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
|
||||
*/
|
||||
function isAdmin() {
|
||||
return isEdgeAdmin();
|
||||
function isAdmin(noEnvScope = false) {
|
||||
return isEdgeAdmin(noEnvScope);
|
||||
}
|
||||
|
||||
// To avoid creating divergence between CE and EE
|
||||
|
|
|
@ -10,7 +10,7 @@ export interface StateManager {
|
|||
export interface IAuthenticationService {
|
||||
getUserDetails(): { ID: number };
|
||||
isAuthenticated(): boolean;
|
||||
isAdmin(): boolean;
|
||||
isAdmin(noEnvScope?: boolean): boolean;
|
||||
isPureAdmin(): boolean;
|
||||
hasAuthorizations(authorizations: string[]): boolean;
|
||||
|
||||
|
|
Loading…
Reference in New Issue