role and Users finished UI work
This commit is contained in:
parent
46ec12c41c
commit
bfb4395b28
7 changed files with 25 additions and 19 deletions
|
@ -220,7 +220,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest {
|
|||
}
|
||||
|
||||
|
||||
//@Test
|
||||
@Test
|
||||
public void testUI() throws Exception {
|
||||
testingClient.server().run(FineGrainAdminUnitTest::setupPolices);
|
||||
testingClient.server().run(FineGrainAdminUnitTest::setupUsers);
|
||||
|
|
|
@ -1297,11 +1297,12 @@ create-ldap-mapper=Create LDAP mapper
|
|||
map-role-mgmt-scope-description=Policies that decide if an admin can map this role to a user or group
|
||||
manage-mgmt-scope-description=Policies that decide if an admin can manage this resource or resources
|
||||
permissions-enabled-role=Permissions Enabled
|
||||
permissions-enabled-role.tooltip=Whether or not to enable fine grain permissions for this role. Disabling will delete all current permissions that have been set up.
|
||||
permissions-enabled-role.tooltip=Whether or not to enable fine grain permissions for managing this role. Disabling will delete all current permissions that have been set up.
|
||||
manage-permissions-role.tooltip=Fine grain permissions for managing roles. For example, you can define different policies for who is allowed to map a role.
|
||||
lookup=Lookup
|
||||
manage-permissions-users.tooltip=Fine grain permssions for managing all users in realm. You can define different policies for who is allowed to manage users in the realm.
|
||||
|
||||
permissions-enabled-users=Permissions Enabled
|
||||
permissions-enabled-users.tooltip=Whether or not to enable fine grain permissions for managing users. Disabling will delete all current permissions that have been set up.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2376,6 +2376,15 @@ module.directive('kcTabsUser', function () {
|
|||
}
|
||||
});
|
||||
|
||||
module.directive('kcTabsUsers', function () {
|
||||
return {
|
||||
scope: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: resourceUrl + '/templates/kc-tabs-users.html'
|
||||
}
|
||||
});
|
||||
|
||||
module.directive('kcTabsGroup', function () {
|
||||
return {
|
||||
scope: true,
|
||||
|
|
|
@ -2367,9 +2367,7 @@ module.controller('RealmRolePermissionsCtrl', function($scope, $http, $route, $l
|
|||
});
|
||||
$scope.setEnabled = function() {
|
||||
var param = { enabled: $scope.permissions.enabled};
|
||||
RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param, function(data) {
|
||||
$scope.permissions = data;
|
||||
})
|
||||
$scope.permissions= RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param);
|
||||
};
|
||||
|
||||
|
||||
|
@ -2384,9 +2382,7 @@ module.controller('ClientRolePermissionsCtrl', function($scope, $http, $route, $
|
|||
});
|
||||
$scope.setEnabled = function() {
|
||||
var param = { enabled: $scope.permissions.enabled};
|
||||
RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param, function(data) {
|
||||
$scope.permissions = data;
|
||||
})
|
||||
$scope.permissions = RoleManagementPermissions.update({realm: realm.realm, role:role.id}, param);
|
||||
};
|
||||
|
||||
|
||||
|
@ -2395,17 +2391,16 @@ module.controller('ClientRolePermissionsCtrl', function($scope, $http, $route, $
|
|||
module.controller('UsersPermissionsCtrl', function($scope, $http, $route, $location, realm, UsersManagementPermissions, Client, Notifications) {
|
||||
console.log('UsersPermissionsCtrl');
|
||||
$scope.realm = realm;
|
||||
UsersManagementPermissions.get({realm: realm.realm, role: role.id}, function(data) {
|
||||
UsersManagementPermissions.get({realm: realm.realm}, function(data) {
|
||||
$scope.permissions = data;
|
||||
});
|
||||
Client.query({realm: realm.realm, clientId: 'realm-management'}, function(data) {
|
||||
$scope.realmManagementClientId = data[0].id;
|
||||
});
|
||||
$scope.setEnabled = function() {
|
||||
$scope.changeIt = function() {
|
||||
console.log('before permissions.enabled=' + $scope.permissions.enabled);
|
||||
var param = { enabled: $scope.permissions.enabled};
|
||||
UsersManagementPermissions.update({realm: realm.realm, role:role.id}, param, function(data) {
|
||||
$scope.permissions = data;
|
||||
})
|
||||
$scope.permissions = UsersManagementPermissions.update({realm: realm.realm}, param);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1387,6 +1387,7 @@ module.controller('ClientScopeMappingCtrl', function($scope, $http, realm, clien
|
|||
}
|
||||
|
||||
$scope.changeFlag = function() {
|
||||
console.log('changeFlag');
|
||||
Client.update({
|
||||
realm : realm.realm,
|
||||
client : client.id
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
<form class=form-horizontal" name="enableForm" novalidate kc-read-only="!access.manageAuthorization">
|
||||
<fieldset class="border-top">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled' | translate}}</label>
|
||||
<label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label>
|
||||
<div class="col-md-6">
|
||||
<input ng-model="permissions.enabled" ng-click="setEnabled()" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
|
||||
</div>
|
||||
<kc-tooltip>{{:: 'permissions-enabled.tooltip' | translate}}</kc-tooltip>
|
||||
<kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<form class=form-horizontal" name="enableForm" novalidate kc-read-only="!access.manageAuthorization">
|
||||
<fieldset class="border-top">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled' | translate}}</label>
|
||||
<label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-users' | translate}}</label>
|
||||
<div class="col-md-6">
|
||||
<input ng-model="permissions.enabled" ng-click="setEnabled()" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
|
||||
<input ng-model="permissions.enabled" ng-click="changeIt()" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
|
||||
</div>
|
||||
<kc-tooltip>{{:: 'permissions-enabled.tooltip' | translate}}</kc-tooltip>
|
||||
<kc-tooltip>{{:: 'permissions-enabled-users.tooltip' | translate}}</kc-tooltip>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue