Merge pull request #2155 from stianst/KEYCLOAK-2424
KEYCLOAK-2424 Add delete role button to client role list
This commit is contained in:
commit
0d842f47a7
2 changed files with 18 additions and 3 deletions
|
@ -18,11 +18,23 @@ module.controller('ClientTabCtrl', function(Dialog, $scope, Current, Notificatio
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('ClientRoleListCtrl', function($scope, $location, realm, client, roles) {
|
module.controller('ClientRoleListCtrl', function($scope, $location, realm, client, roles, $route, RoleById, Notifications, Dialog) {
|
||||||
$scope.realm = realm;
|
$scope.realm = realm;
|
||||||
$scope.roles = roles;
|
$scope.roles = roles;
|
||||||
$scope.client = client;
|
$scope.client = client;
|
||||||
|
|
||||||
|
$scope.removeRole = function(role) {
|
||||||
|
Dialog.confirmDelete(role.name, 'role', function() {
|
||||||
|
RoleById.remove({
|
||||||
|
realm: realm.realm,
|
||||||
|
role: role.id
|
||||||
|
}, function () {
|
||||||
|
$route.reload();
|
||||||
|
Notifications.success("The role has been deleted.");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$scope.$watch(function() {
|
$scope.$watch(function() {
|
||||||
return $location.path();
|
return $location.path();
|
||||||
}, function() {
|
}, function() {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="kc-table-actions" colspan="4" data-ng-show="access.manageClients">
|
<th class="kc-table-actions" colspan="5" data-ng-show="access.manageClients">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a class="btn btn-default" href="#/create/role/{{realm.realm}}/clients/{{client.id}}">{{:: 'add-role' | translate}}</a>
|
<a class="btn btn-default" href="#/create/role/{{realm.realm}}/clients/{{client.id}}">{{:: 'add-role' | translate}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<th>{{:: 'role-name' | translate}}</th>
|
<th>{{:: 'role-name' | translate}}</th>
|
||||||
<th>{{:: 'composite' | translate}}</th>
|
<th>{{:: 'composite' | translate}}</th>
|
||||||
<th>{{:: 'description' | translate}}</th>
|
<th>{{:: 'description' | translate}}</th>
|
||||||
<th>{{:: 'actions' | translate}}</th>
|
<th colspan="2">{{:: 'actions' | translate}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -31,6 +31,9 @@
|
||||||
<td class="kc-action-cell">
|
<td class="kc-action-cell">
|
||||||
<button class="btn btn-default btn-block btn-sm" kc-open="/realms/{{realm.realm}}/clients/{{client.id}}/roles/{{role.id}}">{{:: 'edit' | translate}}</button>
|
<button class="btn btn-default btn-block btn-sm" kc-open="/realms/{{realm.realm}}/clients/{{client.id}}/roles/{{role.id}}">{{:: 'edit' | translate}}</button>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="kc-action-cell">
|
||||||
|
<button class="btn btn-default btn-block btn-sm" data-ng-click="removeRole(role)">{{:: 'delete' | translate}}</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr data-ng-show="!roles || roles.length == 0">
|
<tr data-ng-show="!roles || roles.length == 0">
|
||||||
<td>{{:: 'no-client-roles-available' | translate}}</td>
|
<td>{{:: 'no-client-roles-available' | translate}}</td>
|
||||||
|
|
Loading…
Reference in a new issue