keycloak-memoizeit
Changes
testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/authorization/policy/AggregatePolicyForm.java 43(+38 -5)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html 63(+40 -23)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html 4(+2 -2)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-drools-detail.html 4(+2 -2)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html 4(+2 -2)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html 4(+2 -2)
themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html 7(+4 -3)
Details
diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/authorization/policy/AggregatePolicyForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/authorization/policy/AggregatePolicyForm.java
index 34553d3..cf01f24 100644
--- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/authorization/policy/AggregatePolicyForm.java
+++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/authorization/policy/AggregatePolicyForm.java
@@ -17,8 +17,13 @@
package org.keycloak.testsuite.console.page.clients.authorization.policy;
import static org.keycloak.testsuite.util.UIUtils.performOperationWithPageReload;
+import static org.openqa.selenium.By.tagName;
+import java.util.List;
import java.util.Set;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.stream.Collectors;
import org.jboss.arquillian.graphene.page.Page;
import org.keycloak.representations.idm.authorization.AbstractPolicyRepresentation;
@@ -34,6 +39,7 @@ import org.keycloak.representations.idm.authorization.UserPolicyRepresentation;
import org.keycloak.testsuite.console.page.fragment.ModalDialog;
import org.keycloak.testsuite.console.page.fragment.MultipleStringSelect2;
import org.keycloak.testsuite.page.Form;
+import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;
@@ -56,14 +62,11 @@ public class AggregatePolicyForm extends Form {
private WebElement deleteButton;
@FindBy(id = "s2id_policies")
- private MultipleStringSelect2 policySelect;
+ private PolicySelect policySelect;
@FindBy(xpath = "//div[@class='modal-dialog']")
protected ModalDialog modalDialog;
- @FindBy(id = "create-policy-btn")
- private WebElement createPolicyBtn;
-
@FindBy(id = "create-policy")
private Select createPolicySelect;
@@ -141,7 +144,6 @@ public class AggregatePolicyForm extends Form {
}
public void createPolicy(AbstractPolicyRepresentation expected) {
- createPolicyBtn.click();
performOperationWithPageReload(() -> createPolicySelect.selectByValue(expected.getType()));
if ("role".equals(expected.getType())) {
@@ -160,4 +162,35 @@ public class AggregatePolicyForm extends Form {
groupPolicy.form().populate((GroupPolicyRepresentation) expected, true);
}
}
+
+ public class PolicySelect extends MultipleStringSelect2 {
+
+ @Override
+ protected List<WebElement> getSelectedElements() {
+ return getRoot().findElements(By.xpath("(//table[@id='selected-policies'])/tbody/tr")).stream()
+ .filter(webElement -> webElement.findElements(tagName("td")).size() > 1)
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ protected BiFunction<WebElement, String, Boolean> deselect() {
+ return (webElement, name) -> {
+ List<WebElement> tds = webElement.findElements(tagName("td"));
+
+ if (!tds.get(0).getText().isEmpty()) {
+ if (tds.get(0).getText().equals(name)) {
+ tds.get(2).click();
+ return true;
+ }
+ }
+
+ return false;
+ };
+ }
+
+ @Override
+ protected Function<WebElement, String> representation() {
+ return webElement -> webElement.findElements(tagName("td")).get(0).getText();
+ }
+ }
}
\ No newline at end of file
diff --git a/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties b/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties
index 78a84dd..dd69970 100644
--- a/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties
+++ b/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties
@@ -1106,6 +1106,7 @@ authz-resources=Resources
authz-scope=Scope
authz-authz-scopes=Authorization Scopes
authz-policies=Policies
+authz-policy=Policy
authz-permissions=Permissions
authz-users=Users in Role
authz-evaluate=Evaluate
@@ -1189,7 +1190,8 @@ authz-policy-decision-strategy.tooltip=The decision strategy dictates how the po
authz-policy-decision-strategy-affirmative=Affirmative
authz-policy-decision-strategy-unanimous=Unanimous
authz-policy-decision-strategy-consensus=Consensus
-authz-select-a-policy=Select a policy
+authz-select-a-policy=Select existing policy
+authz-no-policies-assigned=No policies assigned.
# Authz Role Policy Detail
authz-add-role-policy=Add Role Policy
diff --git a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js
index 4bd0525..88a9573 100644
--- a/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js
+++ b/themes/src/main/resources/theme/base/admin/resources/js/authz/authz-controller.js
@@ -2146,6 +2146,48 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
$location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policyType.type + "/create?new_policy=true");
}
+ $scope.detailPolicy = function(policy) {
+ policyState.state = $scope.policy;
+ if ($scope.selectedPolicies) {
+ policyState.state.selectedPolicies = $scope.selectedPolicies;
+ }
+ var previousUrl = window.location.href.substring(window.location.href.indexOf('/realms'));
+
+ if (previousUrl.indexOf('back=true') == -1) {
+ previousUrl = previousUrl + '?back=true';
+ }
+ policyState.state.previousUrl = previousUrl;
+ $location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + policy.type + "/" + policy.id + "?new_policy=true");
+ }
+
+ $scope.removePolicy = function(list, policy) {
+ for (i = 0; i < angular.copy(list).length; i++) {
+ if (policy.id == list[i].id) {
+ list.splice(i, 1);
+ }
+ }
+ }
+
+ $scope.selectPolicy = function(policy) {
+ if (!policy || !policy.id) {
+ return;
+ }
+
+ if (!$scope.selectedPolicies) {
+ $scope.selectedPolicies = [];
+ }
+
+ $scope.selectedPolicy = null;
+
+ for (i = 0; i < $scope.selectedPolicies.length; i++) {
+ if ($scope.selectedPolicies[i].id == policy.id) {
+ return;
+ }
+ }
+
+ $scope.selectedPolicies.push(policy);
+ }
+
$scope.createNewPolicy = function() {
$scope.showNewPolicy = true;
}
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html
index eff6f85..6911daa 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html
@@ -5,8 +5,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-aggregated-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'authz-aggregated' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
@@ -35,32 +35,49 @@
<div class="form-group clearfix">
<label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}} <span class="required">*</span></label>
<div class="col-sm-6">
- <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-model="selectedPolicies" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." multiple data-ng-required="!selectedPolicies || selectedPolicies.length == 0" />
+ <input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." data-ng-required="!selectedPolicies || selectedPolicies.length == 0"/>
+ <p/>
+ <table class="table table-striped table-bordered" id="selected-policies">
+ <thead>
+ <tr>
+ <th class="kc-table-actions" colspan="3">
+ <div class="form-inline">
+ <div class="form-group">
+ </div>
+ <div class="pull-right">
+ <select id="create-policy" class="form-control" ng-model="policyType"
+ ng-options="p.name for p in policyProviders track by p.type"
+ data-ng-change="addPolicy(policyType);">
+ <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
+ </select>
+ </div>
+ </div>
+ </th>
+ </tr>
+ <tr data-ng-hide="!selectedPolicies || selectedPolicies.length == 0">
+ <th>{{:: 'name' | translate}}</th>
+ <th>{{:: 'description' | translate}}</th>
+ <th>{{:: 'actions' | translate}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="policy in selectedPolicies">
+ <td><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
+ <td>{{policy.description}}</td>
+ <td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);">
+ {{:: 'remove' | translate}}
+ </td>
+ </tr>
+ <tr data-ng-show="!selectedPolicies || selectedPolicies.length == 0">
+ <td class="text-muted" colspan="3">{{:: 'authz-no-policies-assigned' | translate}}</td>
+ </tr>
+ </tbody>
+ </table>
</div>
<kc-tooltip>{{:: 'authz-policy-apply-policy.tooltip' | translate}}</kc-tooltip>
</div>
- <div class="form-group clearfix" data-ng-hide="historyBackOnSaveOrCancel">
- <label class="col-md-2 control-label" for="policies"></label>
- <div class="col-sm-6">
- <div class="input-group">
- <div class="input-group-btn" data-ng-hide="showNewPolicy == true">
- <button data-ng-click="createNewPolicy()" id="create-policy-btn" class="btn btn-primary">{{:: 'authz-create-policy' | translate}}</button>
- </div>
- <select id="create-policy" ng-model="policyType" class="form-control"
- ng-options="p.name for p in policyProviders track by p.type"
- data-ng-change="addPolicy(policyType);"
- data-ng-show="showNewPolicy == true">
- <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
- </select>
- <div class="input-group-btn" data-ng-show="showNewPolicy == true">
- <button data-ng-click="cancelCreateNewPolicy()" id="cancel-create-policy-btn" class="btn btn-primary">{{:: 'cancel' | translate}}</button>
- </div>
- </div>
- </div>
- </div>
<div class="form-group clearfix">
<label class="col-md-2 control-label" for="policy.decisionStrategy">{{:: 'authz-policy-decision-strategy' | translate}}</label>
-
<div class="col-sm-2">
<select class="form-control" id="policy.decisionStrategy"
data-ng-model="policy.decisionStrategy"
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html
index 62232dd..85c0769 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html
@@ -5,8 +5,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-client-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'client' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-drools-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-drools-detail.html
index 829fb57..1ab6662 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-drools-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-drools-detail.html
@@ -5,8 +5,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-drools-policy' | translate}}</li>
<li data-ng-hide="create">Rules</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html
index a7fe002..21d6908 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html
@@ -22,8 +22,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-group-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'groups' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html
index 2cbfabe..dc3173c 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html
@@ -8,8 +8,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-js-policy' | translate}}</li>
<li data-ng-hide="create">JavaScript</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html
index f0465c6..2536b5d 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html
@@ -23,8 +23,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{:: policyState.previousPage.name | translate}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{:: policyState.previousPage.name | translate}}</li>
<li data-ng-show="create">{{:: 'authz-add-role-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'roles' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
@@ -159,9 +159,10 @@
<div class="form-group" data-ng-show="access.manageAuthorization">
<div class="col-md-10 col-md-offset-2">
<button kc-save data-ng-disabled="!changed">{{:: 'save' | translate}}</button>
- <button kc-reset data-ng-disabled="!changed">{{:: 'cancel' | translate}}</button>
+ <button kc-reset data-ng-disabled="!changed && !historyBackOnSaveOrCancel">{{:: 'cancel' | translate}}</button>
</div>
</div>
+ {{policyState.page.previous}}
</form>
</div>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html
index 8f356ed..393a10c 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html
@@ -8,8 +8,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-time-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'time' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html
index d04c319..41221fe 100644
--- a/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html
+++ b/themes/src/main/resources/theme/base/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html
@@ -5,8 +5,8 @@
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
<li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy">{{:: 'authz-policies' | translate}}</a></li>
- <li data-ng-show="create && policyState.state.name != null">{{policyState.state.name}}</li>
- <li data-ng-show="create && policyState.state.name == null">{{policyState.previousPage.name}}</li>
+ <li data-ng-show="create && policyState.state.name != null && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
+ <li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="create">{{:: 'authz-add-user-policy' | translate}}</li>
<li data-ng-hide="create">{{:: 'user' | translate}}</li>
<li data-ng-hide="create">{{originalPolicy.name}}</li>
@@ -84,7 +84,7 @@
<div class="form-group" data-ng-show="access.manageAuthorization">
<div class="col-md-10 col-md-offset-2">
<button kc-save data-ng-disabled="!changed">{{:: 'save' | translate}}</button>
- <button kc-reset data-ng-disabled="!changed">{{:: 'cancel' | translate}}</button>
+ <button kc-reset data-ng-disabled="!changed && !historyBackOnSaveOrCancel">{{:: 'cancel' | translate}}</button>
</div>
</div>
</form>