Skip to content

Commit

Permalink
GDB-8709 Remove option to add roles to admin and repo-manager users
Browse files Browse the repository at this point in the history
  • Loading branch information
Emskiqq authored and svilenvelikov committed Sep 14, 2023
1 parent 93feab1 commit bf04a5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/js/angular/security/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,16 @@ securityCtrl.controller('CommonUserCtrl', ['$rootScope', '$scope', '$http', 'toa
setGrantedAuthorities($scope);
};

$scope.resetCustomRoleField = function () {
if (!$scope.isUser()) {
$scope.customRoles = "";
}
};

$scope.isUser = function () {
return $scope.userType === UserType.USER;
};

$scope.hasReadPermission = function (repository) {
const uniqueKey = createUniqueKey(repository);
return $scope.userType === UserType.ADMIN || $scope.userType === UserType.REPO_MANAGER
Expand Down
5 changes: 3 additions & 2 deletions src/js/angular/security/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h3>{{'security.workbench.settings.title' | translate}}

<div class="col-md-6 us-right-col" ng-hide="!isLocalAuthentication()">
<div class="card user-role" id="user-roles">
<div class="card-block">
<div class="card-block" ng-click="resetCustomRoleField()">
<h3>{{'security.user.role' | translate}}</h3>
<label class="mr-1"
uib-popover-template="'popover-content-user.html'"
Expand Down Expand Up @@ -210,7 +210,8 @@ <h3>{{'security.user.role' | translate}}</h3>
<div class="card-block">
<h3>{{'security.user.custom_role' | translate}}</h3>
<div class="input-group">
<tags-input class="wb-tags-input" ng-model="customRoles" min-length="2" ng-disabled="hasEditRestrictions()"
<tags-input class="wb-tags-input" ng-model="customRoles" min-length="2"
ng-disabled="!isUser()"
use-strings="true"
add-on-space="true"
add-on-comma="true"
Expand Down

0 comments on commit bf04a5e

Please sign in to comment.