[KEYCLOAK-5806] - Create policy component to permission pages

This commit is contained in:
pedroigor 2017-12-15 23:41:52 -02:00
parent e2118856ca
commit 5d7ba39e0c
13 changed files with 243 additions and 132 deletions

View file

@ -215,6 +215,7 @@ public class PolicyResourceService {
representation1.setId(policy.getId());
representation1.setName(policy.getName());
representation1.setType(policy.getType());
representation1.setDescription(policy.getDescription());
return representation1;
}).collect(Collectors.toList())).build();

View file

@ -179,7 +179,7 @@ public class AggregatePolicyForm extends Form {
if (!tds.get(0).getText().isEmpty()) {
if (tds.get(0).getText().equals(name)) {
tds.get(2).click();
tds.get(3).click();
return true;
}
}

View file

@ -871,7 +871,7 @@ module.controller('ResourceServerPolicyDroolsDetailCtrl', function($scope, $http
}, realm, client, $scope);
});
module.controller('ResourceServerPolicyResourceDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource) {
module.controller('ResourceServerPolicyResourceDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPermission, ResourceServerResource, policyState) {
PolicyController.onInit({
getPolicyType : function() {
return "resource";
@ -1009,7 +1009,7 @@ module.controller('ResourceServerPolicyResourceDetailCtrl', function($scope, $ro
},
onInitCreate : function(newPolicy) {
newPolicy.decisionStrategy = 'UNANIMOUS';
policyState.state.previousPage.name = 'authz-add-resource-permission';
$scope.selectedResource = null;
var copy = angular.copy($scope.selectedResource);
$scope.$watch('selectedResource', function() {
@ -1058,11 +1058,22 @@ module.controller('ResourceServerPolicyResourceDetailCtrl', function($scope, $ro
$scope.policy.policies = policies;
delete $scope.policy.config;
},
onSaveState : function(policy) {
policyState.state.selectedResource = $scope.selectedResource;
policyState.state.applyToResourceTypeFlag = $scope.applyToResourceTypeFlag;
},
onRestoreState : function(policy) {
$scope.selectedResource = policyState.state.selectedResource;
$scope.applyToResourceTypeFlag = policyState.state.applyToResourceTypeFlag;
policy.resourceType = policyState.state.policy.resourceType;
}
}, realm, client, $scope);
});
module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPolicy, ResourceServerResource, ResourceServerScope) {
module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route, $location, realm, client, PolicyController, ResourceServerPolicy, ResourceServerResource, ResourceServerScope, policyState) {
PolicyController.onInit({
getPolicyType : function() {
return "scope";
@ -1307,8 +1318,7 @@ module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route
},
onInitCreate : function(newPolicy) {
newPolicy.decisionStrategy = 'UNANIMOUS';
policyState.state.previousPage.name = 'authz-add-scope-permission';
var scopeId = $location.search()['scpid'];
if (scopeId) {
@ -1351,6 +1361,18 @@ module.controller('ResourceServerPolicyScopeDetailCtrl', function($scope, $route
$scope.policy.policies = policies;
delete $scope.policy.config;
},
onSaveState : function(policy) {
policyState.state.selectedScopes = $scope.selectedScopes;
policyState.state.selectedResource = $scope.selectedResource;
policyState.state.resourceScopes = $scope.resourceScopes;
},
onRestoreState : function(policy) {
$scope.selectedScopes = policyState.state.selectedScopes;
$scope.selectedResource = policyState.state.selectedResource;
$scope.resourceScopes = policyState.state.resourceScopes;
}
}, realm, client, $scope);
});
@ -1890,6 +1912,7 @@ module.controller('ResourceServerPolicyTimeDetailCtrl', function($scope, $route,
},
onInit : function() {
},
onInitUpdate : function(policy) {
@ -1991,68 +2014,26 @@ module.controller('ResourceServerPolicyAggregateDetailCtrl', function($scope, $r
return object.name;
}
};
$scope.policyProviders = [];
PolicyProvider.query({
realm : $route.current.params.realm,
client : client.id
}, function (data) {
for (i = 0; i < data.length; i++) {
if (data[i].type != 'resource' && data[i].type != 'scope') {
$scope.policyProviders.push(data[i]);
}
}
});
},
onInitUpdate : function(policy) {
if (PolicyController.isBackNewAssociatedPolicy()) {
policy.name = policyState.state.name;
policy.description = policyState.state.description;
policy.decisionStrategy = policyState.state.decisionStrategy;
policy.logic = policyState.state.logic;
$scope.selectedPolicies = policyState.state.selectedPolicies;
if (!$scope.selectedPolicies) {
$scope.selectedPolicies = [];
ResourceServerPolicy.associatedPolicies({
realm : $route.current.params.realm,
client : client.id,
id : policy.id
}, function(policies) {
$scope.selectedPolicies = [];
for (i = 0; i < policies.length; i++) {
policies[i].text = policies[i].name;
$scope.selectedPolicies.push(policies[i]);
}
$scope.changed = true;
ResourceServerPolicy.query({
realm: realm.realm,
client : client.id,
permission: false,
name: policyState.state.newPolicyName,
max : 20,
first : 0
}, function(response) {
for (i = 0; i < response.length; i++) {
if (response[i].name == policyState.state.newPolicyName) {
response[i].text = response[i].name;
$scope.selectedPolicies.push(response[i]);
}
var copy = angular.copy($scope.selectedPolicies);
$scope.$watch('selectedPolicies', function() {
if (!angular.equals($scope.selectedPolicies, copy)) {
$scope.changed = true;
}
});
} else {
ResourceServerPolicy.associatedPolicies({
realm : $route.current.params.realm,
client : client.id,
id : policy.id
}, function(policies) {
$scope.selectedPolicies = [];
for (i = 0; i < policies.length; i++) {
policies[i].text = policies[i].name;
$scope.selectedPolicies.push(policies[i]);
}
var copy = angular.copy($scope.selectedPolicies);
$scope.$watch('selectedPolicies', function() {
if (!angular.equals($scope.selectedPolicies, copy)) {
$scope.changed = true;
}
}, true);
});
}
}, true);
});
},
onUpdate : function() {
@ -2067,37 +2048,7 @@ module.controller('ResourceServerPolicyAggregateDetailCtrl', function($scope, $r
},
onInitCreate : function(newPolicy) {
policyState.previousPage.name = 'authz-add-aggregated-policy';
if (PolicyController.isBackNewAssociatedPolicy()) {
newPolicy.name = policyState.state.name;
newPolicy.description = policyState.state.description;
newPolicy.decisionStrategy = policyState.state.decisionStrategy;
newPolicy.logic = policyState.state.logic;
$scope.selectedPolicies = policyState.state.selectedPolicies;
if (!$scope.selectedPolicies) {
$scope.selectedPolicies = [];
}
$scope.changed = true;
ResourceServerPolicy.query({
realm: realm.realm,
client : client.id,
permission: false,
name: policyState.state.newPolicyName,
max : 20,
first : 0
}, function(response) {
for (i = 0; i < response.length; i++) {
if (response[i].name == policyState.state.newPolicyName) {
response[i].text = response[i].name;
$scope.selectedPolicies.push(response[i]);
}
}
});
} else {
newPolicy.decisionStrategy = 'UNANIMOUS';
}
policyState.state.previousPage.name = 'authz-add-aggregated-policy';
},
onCreate : function() {
@ -2113,7 +2064,7 @@ module.controller('ResourceServerPolicyAggregateDetailCtrl', function($scope, $r
}, realm, client, $scope);
});
module.service("PolicyController", function($http, $route, $location, ResourceServer, ResourceServerPolicy, ResourceServerPermission, AuthzDialog, Notifications, policyState) {
module.service("PolicyController", function($http, $route, $location, ResourceServer, ResourceServerPolicy, ResourceServerPermission, AuthzDialog, Notifications, policyState, PolicyProvider) {
var PolicyController = {};
@ -2126,14 +2077,36 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
PolicyController.onInit = function(delegate, realm, client, $scope) {
if (!policyState.previousPage) {
policyState.previousPage = {};
$scope.policyProviders = [];
PolicyProvider.query({
realm : $route.current.params.realm,
client : client.id
}, function (data) {
for (i = 0; i < data.length; i++) {
if (data[i].type != 'resource' && data[i].type != 'scope') {
$scope.policyProviders.push(data[i]);
}
}
});
if ((!policyState.state || !PolicyController.isBackNewAssociatedPolicy()) && !PolicyController.isNewAssociatedPolicy()) {
policyState.state = {};
}
if (!policyState.state.previousPage) {
policyState.state.previousPage = {};
}
$scope.policyState = policyState;
$scope.addPolicy = function(policyType) {
policyState.state = $scope.policy;
policyState.state.policy = $scope.policy;
if (delegate.onSaveState) {
delegate.onSaveState($scope.policy);
}
if ($scope.selectedPolicies) {
policyState.state.selectedPolicies = $scope.selectedPolicies;
}
@ -2147,7 +2120,10 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
$scope.detailPolicy = function(policy) {
policyState.state = $scope.policy;
policyState.state.policy = $scope.policy;
if (delegate.onSaveState) {
delegate.onSaveState($scope.policy);
}
if ($scope.selectedPolicies) {
policyState.state.selectedPolicies = $scope.selectedPolicies;
}
@ -2236,10 +2212,7 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
policy.type = delegate.getPolicyType();
policy.config = {};
policy.logic = 'POSITIVE';
if (delegate.onInitCreate) {
delegate.onInitCreate(policy);
}
policy.decisionStrategy = 'UNANIMOUS';
$scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy();
@ -2251,6 +2224,15 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
}, true);
if (PolicyController.isBackNewAssociatedPolicy()) {
if (delegate.onRestoreState) {
delegate.onRestoreState($scope.policy);
}
$instance.restoreState($scope);
} else if (delegate.onInitCreate) {
delegate.onInitCreate(policy);
}
$scope.save = function() {
$instance.checkNameAvailability(function () {
if (delegate.onCreate) {
@ -2303,12 +2285,18 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
$scope.originalPolicy = data;
var policy = angular.copy(data);
if (delegate.onInitUpdate) {
$scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy();
if (PolicyController.isBackNewAssociatedPolicy()) {
if (delegate.onRestoreState) {
delegate.onRestoreState($scope.policy);
}
$instance.restoreState($scope);
} else if (delegate.onInitUpdate) {
delegate.onInitUpdate(policy);
}
$scope.policy = angular.copy(policy);
$scope.changed = $scope.historyBackOnSaveOrCancel || PolicyController.isBackNewAssociatedPolicy();
$scope.$watch('policy', function() {
if (!angular.equals($scope.policy, policy)) {
@ -2316,16 +2304,28 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
}, true);
$scope.save = function() {
$instance.checkNameAvailability(function () {
if (delegate.onUpdate) {
delegate.onUpdate();
}
service.update({realm : realm.realm, client : client.id, type: $scope.policy.type, id : $scope.policy.id}, $scope.policy, function() {
$route.reload();
if (delegate.isPermission()) {
if ($scope.historyBackOnSaveOrCancel) {
$location.url(policyState.state.previousUrl);
} else {
$location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/permission/" + $scope.policy.type + "/" + $scope.policy.id);
}
$route.reload();
Notifications.success("The permission has been updated.");
} else {
if ($scope.historyBackOnSaveOrCancel) {
$location.url(policyState.state.previousUrl);
} else {
$location.url("/realms/" + realm.realm + "/clients/" + client.id + "/authz/resource-server/policy/" + $scope.policy.type + "/" + $scope.policy.id);
}
$route.reload();
Notifications.success("The policy has been updated.");
}
});
@ -2374,6 +2374,44 @@ module.service("PolicyController", function($http, $route, $location, ResourceSe
}
});
}
this.restoreState = function($scope) {
$scope.policy.name = policyState.state.policy.name;
$scope.policy.description = policyState.state.policy.description;
$scope.policy.decisionStrategy = policyState.state.policy.decisionStrategy;
$scope.policy.logic = policyState.state.policy.logic;
$scope.selectedPolicies = policyState.state.selectedPolicies;
if (!$scope.selectedPolicies) {
$scope.selectedPolicies = [];
}
$scope.changed = true;
var previousPage = policyState.state.previousPage;
if (policyState.state.newPolicyName) {
ResourceServerPolicy.query({
realm: realm.realm,
client : client.id,
permission: false,
name: policyState.state.newPolicyName,
max : 20,
first : 0
}, function(response) {
for (i = 0; i < response.length; i++) {
if (response[i].name == policyState.state.newPolicyName) {
response[i].text = response[i].name;
$scope.selectedPolicies.push(response[i]);
}
}
policyState.state = {};
policyState.state.previousPage = previousPage;
});
} else {
policyState.state = {};
policyState.state.previousPage = previousPage;
}
}
}
return PolicyController;

View file

@ -54,11 +54,46 @@
</div>
<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-md-6">
<input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-model="selectedPolicies" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." multiple />
<div class="col-sm-6">
<input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." />
<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">

View file

@ -58,11 +58,46 @@
</div>
<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-md-6">
<input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-model="selectedPolicies" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." multiple />
<div class="col-sm-6">
<input type="hidden" ui-select2="policiesUiSelect" id="policies" data-ng-change="selectPolicy(selectedPolicy);" data-ng-model="selectedPolicy" data-placeholder="{{:: 'authz-select-a-policy' | translate}}..." />
<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">

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>
@ -47,7 +47,8 @@
<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);">
data-ng-change="addPolicy(policyType);"
data-ng-hide="historyBackOnSaveOrCancel">
<option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option>
</select>
</div>
@ -62,7 +63,8 @@
</thead>
<tbody>
<tr ng-repeat="policy in selectedPolicies">
<td><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
<td data-ng-hide="historyBackOnSaveOrCancel"><a href="" data-ng-click="detailPolicy(policy)">{{policy.name}}</a></td>
<td data-ng-show="historyBackOnSaveOrCancel">{{policy.name}}</td>
<td>{{policy.description}}</td>
<td class="kc-action-cell" ng-click="removePolicy(selectedPolicies, policy);">
{{:: 'remove' | translate}}

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{:: policyState.previousPage.name | translate}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>

View file

@ -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 && historyBackOnSaveOrCancel">{{policyState.state.name}}</li>
<li data-ng-show="create && policyState.state.name == null && historyBackOnSaveOrCancel">{{policyState.previousPage.name}}</li>
<li data-ng-show="policyState.state.policy.name != null && historyBackOnSaveOrCancel">{{policyState.state.policy.name}}</li>
<li data-ng-show="policyState.state.policy.name == null && historyBackOnSaveOrCancel">{{:: policyState.state.previousPage.name | translate}}</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>