1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +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

@ -550,7 +550,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
});
var userDetails = Authentication.getUserDetails();
$scope.isAdmin = userDetails.role === 1 ? true : false;
$scope.isAdmin = userDetails.role === 1;
}
function validateForm(accessControlData, isAdmin) {
@ -574,7 +574,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
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;