1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

refactor(webapp): simplify isAdmin statement (#1388)

This commit is contained in:
Thomas Kooi 2017-11-14 08:54:35 +01:00 committed by Anthony Lapenna
parent 521cc3d6ab
commit 3548f0db6f
8 changed files with 11 additions and 11 deletions

View file

@ -387,7 +387,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
var accessControlData = $scope.formValues.AccessControlData;
var userDetails = Authentication.getUserDetails();
var isAdmin = userDetails.role === 1 ? true : false;
var isAdmin = userDetails.role === 1;
if (!validateForm(accessControlData, isAdmin)) {
return;
@ -443,7 +443,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
var settings = data.settings;
$scope.allowBindMounts = settings.AllowBindMountsForRegularUsers;
var userDetails = Authentication.getUserDetails();
$scope.isAdmin = userDetails.role === 1 ? true : false;
$scope.isAdmin = userDetails.role === 1;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to initialize view');