Disable role selection for Cloudrons with user restriction
This commit is contained in:
@@ -44,10 +44,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group" ng-show="userInfo.isAtLeastOwner">
|
||||
<label class="control-label">Role</label>
|
||||
<div class="control-label">
|
||||
<select class="form-control" ng-model="useradd.role" ng-options="a.id as a.name for a in roles" ng-disabled="!userInfo.isAtLeastOwner"></select>
|
||||
<select class="form-control" ng-model="useradd.role" ng-options="role.id as role.name disable when role.disabled for role in roles"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -128,10 +128,10 @@
|
||||
</div>
|
||||
<input type="fallbackEmail" class="form-control" ng-model="useredit.fallbackEmail" name="fallbackEmail" required>
|
||||
</div>
|
||||
<div class="form-group" ng-hide="isMe(useredit.userInfo) || userInfo.role === 'user' || userInfo.role === 'usermanager'">
|
||||
<div class="form-group" ng-show="!isMe(useredit.userInfo) && userInfo.isAtLeastOwner">
|
||||
<label class="control-label">Role</label>
|
||||
<div class="control-label">
|
||||
<select class="form-control" ng-model="useredit.role" ng-options="a.id as a.name for a in roles"></select>
|
||||
<select class="form-control" ng-model="useredit.role" ng-options="role.id as role.name disable when role.disabled for role in roles"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
+15
-4
@@ -26,10 +26,10 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
$scope.userInfo = Client.getUserInfo();
|
||||
|
||||
$scope.roles = [
|
||||
{ id: 'user', name: 'User' },
|
||||
{ id: 'usermanager', name: 'User Manager' },
|
||||
{ id: 'admin', name: 'Administrator' },
|
||||
{ id: 'owner', name: 'Owner' }
|
||||
{ id: 'user', name: 'User', disabled: false },
|
||||
{ id: 'usermanager', name: 'User Manager', disabled: true },
|
||||
{ id: 'admin', name: 'Administrator', disabled: true },
|
||||
{ id: 'owner', name: 'Owner', disabled: true }
|
||||
];
|
||||
|
||||
$scope.allUsers = [];
|
||||
@@ -681,6 +681,17 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
}
|
||||
});
|
||||
});
|
||||
Client.onReady(function () {
|
||||
// Update available roles depending on features
|
||||
if ($scope.config.features.userMaxCount === null) {
|
||||
$scope.roles = [
|
||||
{ id: 'user', name: 'User', disabled: false },
|
||||
{ id: 'usermanager', name: 'User Manager', disabled: false },
|
||||
{ id: 'admin', name: 'Administrator', disabled: false },
|
||||
{ id: 'owner', name: 'Owner', disabled: false }
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
// setup all the dialog focus handling
|
||||
['userAddModal', 'userRemoveModal', 'userEditModal', 'groupAddModal', 'groupEditModal', 'groupRemoveModal'].forEach(function (id) {
|
||||
|
||||
Reference in New Issue
Block a user