diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js
index 7e7a409..2669771 100755
--- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js
+++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js
@@ -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.roles = roles;
$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() {
return $location.path();
}, function() {
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html
index 98e2acd..39be3b2 100755
--- a/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/client-role-list.html
@@ -10,7 +10,7 @@
<table class="table table-striped table-bordered">
<thead>
<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">
<a class="btn btn-default" href="#/create/role/{{realm.realm}}/clients/{{client.id}}">{{:: 'add-role' | translate}}</a>
</div>
@@ -20,7 +20,7 @@
<th>{{:: 'role-name' | translate}}</th>
<th>{{:: 'composite' | translate}}</th>
<th>{{:: 'description' | translate}}</th>
- <th>{{:: 'actions' | translate}}</th>
+ <th colspan="2">{{:: 'actions' | translate}}</th>
</tr>
</thead>
<tbody>
@@ -31,6 +31,9 @@
<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>
</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 data-ng-show="!roles || roles.length == 0">
<td>{{:: 'no-client-roles-available' | translate}}</td>