Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
fix(): an admin can see all submenus even if the dev mode is on 'Deve…
Browse files Browse the repository at this point in the history
…loper Portal Only'

Fix gravitee-io/issues#2240
  • Loading branch information
phiz71 committed May 15, 2019
1 parent 875406a commit 305d153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.route.ts
Expand Up @@ -61,7 +61,7 @@ function routerConfig($stateProvider: StateProvider, $urlServiceProvider: UrlSer
let isMenuItem = routeMenuItem.data.menu.firstLevel;
let isMenuAllowed = !routeMenuItem.data.perms || !routeMenuItem.data.perms.only
|| graviteeUser.allowedTo(routeMenuItem.data.perms.only);
if (Constants.portal.devMode.enabled) {
if (Constants.portal.devMode.enabled && !graviteeUser.isAdmin()) {
return isMenuItem && isMenuAllowed && routeMenuItem.data.devMode;
} else {
return isMenuItem && isMenuAllowed;
Expand Down
2 changes: 1 addition & 1 deletion src/management/management.run.ts
Expand Up @@ -32,7 +32,7 @@ function runBlock($rootScope, $window, $http, $mdSidenav, $transitions, $state,
let fromState = trans.from();
let toState = trans.to();

let notEligibleForDevMode = Constants.portal.devMode.enabled && toState.data && !toState.data.devMode;
let notEligibleForDevMode = Constants.portal.devMode.enabled && toState.data && !toState.data.devMode && !UserService.currentUser.isAdmin();
let notEligibleForUserCreation = !Constants.portal.userCreation.enabled && (fromState.name === 'registration' || fromState === 'confirm');

if (notEligibleForDevMode || notEligibleForUserCreation) {
Expand Down

0 comments on commit 305d153

Please sign in to comment.