diff options
Diffstat (limited to 'admin/resources/partials/authz/policy')
10 files changed, 1248 insertions, 0 deletions
diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html new file mode 100644 index 0000000..25be65b --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html @@ -0,0 +1,123 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-aggregated-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </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-sm-6"> + <table class="table table-striped table-bordered" style="margin-top: 0px" id="selected-policies"> + <thead> + <tr> + <th class="kc-table-actions" colspan="2"> + <div class="form-inline col-md-12" style="width: 107%"> + <div class="form-group" style="width: 100%"> + <div class="input-group" style="width: 100%"> + <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"/> + </div> + </div> + </div> + </th> + <th class="kc-table-actions"> + <div class="pull-right" style="width: 100%"> + <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-hide="historyBackOnSaveOrCancel"> + <option value="" disabled selected>{{:: 'authz-create-policy' | translate}}...</option> + </select> + </div> + </th> + </tr> + <tr data-ng-hide="!selectedPolicies || selectedPolicies.length == 0"> + <th>{{:: 'name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th width="20%">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="policy in selectedPolicies"> + <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);" style="vertical-align: middle"> + {{:: '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"> + <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" + ng-change="selectDecisionStrategy()"> + <option value="UNANIMOUS">{{:: 'authz-policy-decision-strategy-unanimous' | translate}}</option> + <option value="AFFIRMATIVE">{{:: 'authz-policy-decision-strategy-affirmative' | translate}}</option> + <option value="CONSENSUS">{{:: 'authz-policy-decision-strategy-consensus' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-decision-strategy.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" name="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + + <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 || (selectedPolicies == null || selectedPolicies.length == 0)">{{:: 'save' | translate}}</button> + <button kc-reset data-ng-disabled="!changed">{{:: 'cancel' | translate}}</button> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html new file mode 100644 index 0000000..9c5630a --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-client-detail.html @@ -0,0 +1,93 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-client-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="clients">{{:: 'clients' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-model="selectedClient" data-ng-change="selectClient(selectedClient);" data-placeholder="Select an client..." data-ng-required="selectedClients.length == 0"> + </input> + </div> + <kc-tooltip>{{:: 'authz-policy-client-clients.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" style="margin-top: -15px;"> + <label class="col-md-2 control-label"></label> + <div class="col-sm-3"> + <table class="table table-striped table-bordered" id="selected-clients"> + <thead> + <tr data-ng-hide="!selectedClients.length"> + <th>{{:: 'clientId' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="client in selectedClients | orderBy:'clientId'"> + <td>{{client.clientId}}</td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" ng-click="removeFromList(client);">{{:: 'remove' | translate}}</button> + </td> + </tr> + <tr data-ng-show="!selectedClients.length"> + <td class="text-muted" colspan="3">{{:: 'authz-no-clients-assigned' | translate}}</td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + + <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> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html new file mode 100644 index 0000000..cc1353b --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-group-detail.html @@ -0,0 +1,126 @@ +<!-- + ~ * Copyright 2017 Red Hat, Inc. and/or its affiliates + ~ * and other contributors as indicated by the @author tags. + ~ * + ~ * Licensed under the Apache License, Version 2.0 (the "License"); + ~ * you may not use this file except in compliance with the License. + ~ * You may obtain a copy of the License at + ~ * + ~ * http://www.apache.org/licenses/LICENSE-2.0 + ~ * + ~ * Unless required by applicable law or agreed to in writing, software + ~ * distributed under the License is distributed on an "AS IS" BASIS, + ~ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ * See the License for the specific language governing permissions and + ~ * limitations under the License. + --> + +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-group-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="groupPolicyForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="groupsClaim">{{:: 'authz-policy-group-claim' | translate}}</label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="groupsClaim" name="groupsClaim" data-ng-model="policy.groupsClaim"> + </div> + <kc-tooltip>{{:: 'authz-policy-group-claim.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="selectedGroups">{{:: 'groups' | translate}} <span class="required">*</span></label> + <div class="col-md-6"> + <div tree-id="tree" + angular-treeview="true" + tree-model="groupList" + node-id="id" + node-label="name" + node-children="subGroups" > + </div> + <button data-ng-click="selectGroup(tree.currentNode)" id="selectGroup" class="btn btn-primary" data-ng-disabled="tree.currentNode == null">Select</button> + <input class="form-control" type="text" id="selectedGroups" name="selectedGroups" data-ng-model="noop" data-ng-required="selectedGroups.length <= 0" autofocus required data-ng-show="false"> + </div> + <kc-tooltip>{{:: 'authz-policy-user-users.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group" data-ng-if="selectedGroups.length > 0"> + <label class="col-md-2 control-label"></label> + <div class="col-md-5"> + <table class="table table-striped table-bordered" id="selected-groups"> + <thead> + <tr> + <th>{{:: 'path' | translate}}</th> + <th class="col-sm-3">Extend to Children</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="group in selectedGroups | orderBy:'name' track by $index"> + <td>{{group.path}}</td> + <td> + <input type="checkbox" ng-model="group.extendChildren" id="{{role.id}}" data-ng-click="extendChildren()"> + </td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" ng-click="removeFromList(group);">{{:: 'remove' | translate}}</button> + </td> + </tr> + <tr data-ng-show="!selectedGroups.length"> + <td class="text-muted" colspan="3">{{:: 'authz-no-groups-assigned' | translate}}</td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + <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> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html new file mode 100644 index 0000000..172c2b6 --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-js-detail.html @@ -0,0 +1,69 @@ +<style> + .ace_editor { height: 200px; } +</style> +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-js-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()" data-ng-disabled="readOnly"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description" data-ng-disabled="readOnly"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="code">{{:: 'authz-policy-js-code' | translate}} </label> + <div class="col-sm-6"> + <div ui-ace="{ onLoad : initEditor }" id="code" data-ng-model="policy.code"></div> + </div> + <kc-tooltip>{{:: 'authz-policy-js-code.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic" data-ng-disabled="readOnly"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + + <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> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html new file mode 100644 index 0000000..9448682 --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-role-detail.html @@ -0,0 +1,169 @@ +<!-- + ~ JBoss, Home of Professional Open Source. + ~ Copyright 2016 Red Hat, Inc., and individual contributors + ~ as indicated by the @author tags. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-role-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="roles">{{:: 'realm-roles' | translate}} <span class="required">*</span></label> + + <div class="col-md-4"> + <select ui-select2="{ minimumInputLength: 1}" id="roles" data-ng-model="selectedRole" data-ng-change="selectRole(selectedRole);" data-placeholder="{{:: 'select-a-role' | translate}}..." + ng-options="role as role.name for role in roles" data-ng-required="selectedRoles.length == 0"> + <option></option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-role-realm-roles.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" style="margin-top: -15px;"> + <label class="col-md-2 control-label"></label> + <div class="col-sm-4" data-ng-show="hasRealmRole()"> + <table class="table table-striped table-bordered" id="selected-realm-roles"> + <thead> + <tr> + <th class="col-sm-5">{{:: 'name' | translate}}</th> + <th>{{:: 'authz-required' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="role in selectedRoles | orderBy:'name'" ng-if="!role.clientRole"> + <td>{{role.name}}</td> + <td><input type="checkbox" ng-model="role.required" id="{{role.id}}"></td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" ng-click="removeFromList(role);">{{:: 'remove' | translate}}</button> + </td> + </tr> + <tr data-ng-show="!selectedRoles.length"> + <td class="text-muted" colspan="3">{{:: 'authz-no-roles-assigned' | translate}}</td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="clients">{{:: 'clients' | translate}}</label> + + <div class="col-md-4"> + <select class="form-control" id="clients" + ng-model="selectedClient" + ng-change="selectClient()" + data-ng-options="current as current.clientId for current in clients"> + <option value="">{{:: 'selectOne' | translate}}...</option> + </select> + </div> + <kc-tooltip>{{:: 'authz-policy-role-clients.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="clientRoles">{{:: 'client-roles' | translate}} <span class="required">*</span></label> + + <div class="col-md-4"> + <select ui-select2="{ minimumInputLength: 1}" id="clientRoles" data-ng-model="selectedRole" data-ng-change="selectRole(selectedRole);" data-placeholder="{{:: 'select-a-role' | translate}}..." + ng-options="role as role.name for role in clientRoles" data-ng-required="selectedRoles.length == 0" data-ng-disabled="!selectedClient"> + <option></option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-role-client-roles.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" style="margin-top: -15px;"> + <label class="col-md-2 control-label"></label> + <div class="col-sm-4" data-ng-show="hasClientRole()"> + <table class="table table-striped table-bordered" id="selected-client-roles"> + <thead> + <tr> + <th class="col-sm-5">{{:: 'name' | translate}}</th> + <th class="col-sm-5">{{:: 'client' | translate}}</th> + <th>{{:: 'authz-required' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="role in selectedRoles | orderBy:'name'" ng-if="role.clientRole"> + <td>{{role.name}}</td> + <td>{{role.container.name}}</td> + <td><input type="checkbox" ng-model="role.required" id="{{role.id}}"></td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" ng-click="removeFromList(role);">{{:: 'remove' | translate}}</button> + </td> + </tr> + <tr data-ng-show="!selectedRoles.length"> + <td class="text-muted" colspan="3">{{:: 'authz-no-roles-assigned' | translate}}</td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + <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 && !historyBackOnSaveOrCancel">{{:: 'cancel' | translate}}</button> + </div> + </div> + {{policyState.page.previous}} + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html new file mode 100644 index 0000000..4af9014 --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-time-detail.html @@ -0,0 +1,119 @@ +<style> + .ace_editor { height: 200px; } +</style> +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + + <h1 data-ng-show="create">{{:: 'authz-add-time-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="notBefore">{{:: 'not-before' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" style="width: 150px" type="text" id="notBefore" name="notBefore" data-ng-model="policy.notBefore" placeholder="yyyy-MM-dd hh:mm:ss" data-ng-required="isRequired()"> + </div> + <kc-tooltip>{{:: 'authz-policy-time-not-before.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="notOnOrAfter">{{:: 'authz-policy-time-not-on-after' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" style="width: 150px" type="text" id="notOnOrAfter" name="notOnOrAfter" data-ng-model="policy.notOnOrAfter" placeholder="yyyy-MM-dd hh:mm:ss" data-ng-required="isRequired()"> + </div> + <kc-tooltip>{{:: 'authz-policy-time-not-on-after.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="dayMonth">{{:: 'authz-policy-time-day-month' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" type="number" min="1" max="31" data-ng-model="policy.dayMonth" id="dayMonth" name="dayMonth" data-ng-required="isRequired()"/> to <input class="form-control" type="number" min="{{policy.dayMonth}}" max="31" data-ng-model="policy.dayMonthEnd" id="dayMonthEnd" name="dayMonthEnd"/> + </div> + <kc-tooltip>{{:: 'authz-policy-time-day-month.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="month">{{:: 'authz-policy-time-month' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" type="number" min="1" max="12" data-ng-model="policy.month" id="month" name="month" data-ng-required="isRequired()"/> to <input class="form-control" type="number" min="{{policy.month}}" max="12" data-ng-model="policy.monthEnd" id="monthEnd" name="monthEnd"/> + </div> + <kc-tooltip>{{:: 'authz-policy-time-month.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="year">{{:: 'authz-policy-time-year' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" type="number" data-ng-model="policy.year" id="year" name="year" data-ng-required="isRequired()"/> to <input class="form-control" type="number" min="{{policy.year}}" max="2050" data-ng-model="policy.yearEnd" id="yearEnd" name="yearEnd"/> + </div> + <kc-tooltip>{{:: 'authz-policy-time-year.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="hour">{{:: 'authz-policy-time-hour' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" type="number" min="0" max="23" data-ng-model="policy.hour" id="hour" name="hour" data-ng-required="isRequired()"/> to <input class="form-control" type="number" min="{{policy.hour}}" max="23" data-ng-model="policy.hourEnd" id="hourEnd" name="hourEnd"/> + </div> + <kc-tooltip>{{:: 'authz-policy-time-hour.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="minute">{{:: 'authz-policy-time-minute' | translate}}</label> + + <div class="col-md-6 time-selector"> + <input class="form-control" type="number" min="0" max="59" data-ng-model="policy.minute" id="minute" name="minute" data-ng-required="isRequired()"/> to <input class="form-control" type="number" min="{{policy.minute}}" max="59" data-ng-model="policy.minuteEnd" id="minuteEnd" name="minuteEnd"/> + </div> + <kc-tooltip>{{:: 'authz-policy-time-minute.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + + <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> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html b/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html new file mode 100644 index 0000000..80d81ac --- /dev/null +++ b/admin/resources/partials/authz/policy/provider/resource-server-policy-user-detail.html @@ -0,0 +1,93 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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="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> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-user-policy' | translate}}</h1> + <h1 data-ng-hide="create">{{originalPolicy.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-click="remove()"></i></h1> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="policy.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-policy-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="description" name="description" data-ng-model="policy.description"> + </div> + <kc-tooltip>{{:: 'authz-policy-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="users">{{:: 'users' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="usersUiSelect" id="users" data-ng-model="selectedUser" data-ng-change="selectUser(selectedUser);" data-placeholder="Select an user..." data-ng-required="selectedUsers.length == 0""> + </input> + </div> + <kc-tooltip>{{:: 'authz-policy-user-users.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" style="margin-top: -15px;"> + <label class="col-md-2 control-label"></label> + <div class="col-sm-3"> + <table class="table table-striped table-bordered" id="selected-users"> + <thead> + <tr data-ng-hide="!selectedUsers.length"> + <th>{{:: 'username' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="user in selectedUsers | orderBy:'username'"> + <td>{{user.username}}</td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" ng-click="removeFromList(selectedUsers, user);">{{:: 'remove' | translate}}</button> + </td> + </tr> + <tr data-ng-show="!selectedUsers.length"> + <td class="text-muted" colspan="3">{{:: 'authz-no-users-assigned' | translate}}</td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="logic">{{:: 'authz-policy-logic' | translate}}</label> + + <div class="col-sm-1"> + <select class="form-control" id="logic" + data-ng-model="policy.logic"> + <option value="POSITIVE">{{:: 'authz-policy-logic-positive' | translate}}</option> + <option value="NEGATIVE">{{:: 'authz-policy-logic-negative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-policy-logic.tooltip' | translate}}</kc-tooltip> + </div> + <input type="hidden" data-ng-model="policy.type"/> + </fieldset> + + <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 && !historyBackOnSaveOrCancel">{{:: 'cancel' | translate}}</button> + </div> + </div> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html b/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html new file mode 100644 index 0000000..19ff720 --- /dev/null +++ b/admin/resources/partials/authz/policy/resource-server-policy-evaluate-result.html @@ -0,0 +1,72 @@ +<fieldset> + <form class="form-horizontal" name="clientForm" novalidate> + <span data-ng-show="evaluationResult.results.length == 0"><strong>{{:: 'authz-evaluation-no-result' | translate}}</strong></span> + <fieldset class="border-top" data-ng-repeat="result in evaluationResult.results"> + <legend collapsed><span class="text">{{result.resource.name}}</span> + </legend> + <div class="form-group"> + <label class="col-md-2 control-label">{{:: 'authz-result' | translate}}</label> + + <div class="col-sm-2"> + <div> + <span style="color: green" + data-ng-show="result.status == 'PERMIT'"><strong>{{result.status}}</strong></span> + <span style="color: red" + data-ng-hide="result.status == 'PERMIT'"><strong>{{result.status}}</strong></span> + </div> + </div> + <kc-tooltip>{{:: 'authz-evaluation-result.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label">{{:: 'authz-scopes' | translate}}</label> + + <div class="col-sm-2"> + <span data-ng-show="result.allowedScopes.length == 0">{{:: 'authz-no-scopes-available' | translate}}</span> + + <div> + <ul> + <li data-ng-repeat="scope in result.allowedScopes"> + {{scope.name}} + </li> + </ul> + </div> + </div> + <kc-tooltip>{{:: 'authz-evaluation-scopes.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group" data-ng-show="!evaluationResult.entitlements"> + <label class="col-md-2 control-label">{{:: 'authz-policies' | translate}}</label> + + <div class="col-sm-6"> + <span data-ng-show="result.policies.length == 0">{{:: 'authz-evaluation-no-policies-resource' | translate}}</span> + <div> + <div> + <li data-ng-repeat="policyResult in result.policies"> + <strong> + <a data-ng-show="policyResult.policy.type != 'uma'" + href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/permission/{{policyResult.policy.type}}/{{policyResult.policy.id}}">{{policyResult.policy.name}}</a> + <a data-ng-show="policyResult.policy.type == 'uma'" + href=""> + {{policyResult.policy.description}} + </a> + </strong> + decision was <span style="color: green" data-ng-show="policyResult.status == 'PERMIT'"><strong>{{policyResult.status}}</strong></span> + <span style="color: red" data-ng-hide="policyResult.status == 'PERMIT'"><strong>{{policyResult.status}}</strong></span> + by <strong>{{policyResult.policy.decisionStrategy}}</strong> decision. {{policyResult.policy.scopes.length > 0 ? (policyResult.status == 'DENY' ? 'Denied Scopes:' : 'Granted Scopes:') : ''}} <span data-ng-repeat="scope in policyResult.policy.scopes"><strong style="color: {{(policyResult.status == 'DENY' ? 'red' : 'green')}}">{{scope}}{{$last ? '' : ', '}}</strong></span>{{policyResult.policy.scopes.length > 0 ? '.' : ''}} + <ul data-ng-show="policyResult.policy.type != 'uma'"> + <li data-ng-repeat="subPolicy in policyResult.associatedPolicies"> + <strong><a + href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy/{{subPolicy.policy.type}}/{{subPolicy.policy.id}}">{{subPolicy.policy.name}}</a></strong> + voted to <span style="color: green" + data-ng-show="subPolicy.status == 'PERMIT'"><strong>{{subPolicy.status}}</strong></span> + <span style="color: red" data-ng-hide="subPolicy.status == 'PERMIT'"><strong>{{subPolicy.status}}</strong></span>.</a> + </li> + </ul> + </li> + </ul> + </div> + </div> + <kc-tooltip>{{:: 'authz-evaluation-policies.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> +</fieldset>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html b/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html new file mode 100644 index 0000000..aedbdea --- /dev/null +++ b/admin/resources/partials/authz/policy/resource-server-policy-evaluate.html @@ -0,0 +1,267 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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/evaluate">{{:: 'authz-policy-evaluation' | translate}}</a></li> + </ol> + + <kc-tabs-resource-server></kc-tabs-resource-server> + + <div data-ng-show="showResult"> + <br> + <a href="" data-ng-click="showRequestTab()">{{:: 'back' | translate}}</a> + | + <a href="" data-ng-click="reevaluate()">{{:: 'authz-evaluation-re-evaluate' | translate}}</a> + | + <a href="" data-ng-click="showAuthzData()">{{:: 'authz-show-authorization-data' | translate}}</a> + </div> + + <div data-ng-show="evaluationResult && !showResult"> + <br> + <a href="" data-ng-click="showResultTab()">{{:: 'authz-evaluation-previous' | translate}}</a> + </div> + + <div data-ng-show="showRpt"> + <div class="form-group"> + <label class="col-sm-1 control-label" for="rpt">{{:: 'authz-evaluation-authorization-data' | translate}}</label> + <div class="col-md-6"> + <textarea id="rpt" class="form-control" rows="20">{{evaluationResult.rpt | json}}</textarea> + </div> + <kc-tooltip>{{:: 'authz-evaluation-authorization-data.tooltip' | translate}}</kc-tooltip> + </div> + </div> + + <div data-ng-hide="showResult"> + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset> + <fieldset class="border-top"> + <legend><span class="text">{{:: 'authz-evaluation-identity-information' | translate}}</span> + <kc-tooltip>{{:: 'authz-evaluation-identity-information.tooltip' | translate}}</kc-tooltip> + </legend> + <div class="form-group"> + <label class="col-md-2 control-label" for="client">{{:: 'client' | translate}}</label> + + <div class="col-sm-2"> + <div> + <select class="form-control" id="client" + ng-model="authzRequest.clientId" + ng-options="client.id as client.clientId for client in clients track by client.id"> + <option value="">{{:: 'authz-select-client' | translate}}...</option> + </select> + </div> + </div> + <kc-tooltip>{{:: 'authz-evaluation-client.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="users">{{:: 'user' | translate}} <span class="required" + data-ng-show="!authzRequest.roleIds || authzRequest.roleIds.length == 0">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="usersUiSelect" id="users" data-ng-model="selectedUser" data-ng-change="selectUser(selectedUser);" data-placeholder="{{:: 'authz-select-user' | translate}}..." + data-ng-required="!authzRequest.roleIds || authzRequest.roleIds.length == 0"> + </input> + </div> + + <kc-tooltip>{{:: 'authz-evaluation-user.tooltip' | translate}}</kc-tooltip> + </div> + + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="reqActions">{{:: 'roles' | translate}} <span class="required" + data-ng-show="!authzRequest.userId || authzRequest.userId == null">*</span></label> + + <div class="col-md-6"> + <select ui-select2="{ minimumInputLength: 1}" + data-ng-model="authzRequest.roleIds" + data-placeholder="{{:: 'authz-any-role' | translate}}..." multiple + data-ng-required="!authzRequest.userId || authzRequest.userId == null"> + <option ng-repeat="role in roles track by role.id" value="{{role.name}}">{{role.name}} + </option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-evaluation-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + <fieldset> + <legend collapsed><span class="text">{{:: 'authz-evaluation-contextual-info' | translate}}</span> + <kc-tooltip>{{:: 'authz-evaluation-contextual-info.tooltip' | translate}}</kc-tooltip> + </legend> + <div class="form-group clearfix block"> + <label class="col-md-2 control-label" for="newRedirectUri">{{:: 'authz-evaluation-contextual-attributes' | translate}}</label> + + <div class="col-sm-6"> + <table class="table table-striped table-bordered"> + <thead> + <tr> + <th>{{:: 'key' | translate}}</th> + <th>{{:: 'value' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(key, value) in (authzRequest.context.attributes)"> + <td>{{getContextAttributeName(key)}}</td> + <td> + <select class="form-control" id="attribute-{{key}}" + data-ng-model="authzRequest.context.attributes[key]" + data-ng-show="getContextAttribute(key).values" + ng-options="value1.key as value1.name for value1 in getContextAttribute(key).values"> + </select> + <input ng-model="authzRequest.context.attributes[key]" class="form-control" + type="text" name="{{key}}" id="attribute-{{key}}" + data-ng-hide="getContextAttribute(key).values"/> + </td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" + data-ng-click="removeContextAttribute(key)">{{:: 'delete' | translate}} + </button> + </td> + </tr> + <tr> + <td> + <select class="form-control" id="newContextAttribute.key" + data-ng-model="newContextAttribute" + ng-change="selectDefaultContextAttribute()" + data-ng-hide="!isDefaultContextAttribute()" + ng-options="attribute as attribute.name for attribute in defaultContextAttributes track by attribute.key"> + </select> + <input ng-model="newContextAttribute.key" class="form-control" type="text" + id="newAttributeKey" data-ng-hide="isDefaultContextAttribute()"/> + </td> + <td> + <select class="form-control" id="newContextAttribute.value" + data-ng-model="newContextAttribute.value" + data-ng-show="newContextAttribute.values" + ng-options="value.key as value.name for value in newContextAttribute.values track by value.key"> + </select> + <input ng-model="newContextAttribute.value" class="form-control" type="text" + id="newAttributeValue" data-ng-show="!newContextAttribute.values"/> + </td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" + data-ng-click="addContextAttribute()" + data-ng-disabled="!newContextAttribute.key || newContextAttribute.key == ''"> + {{:: 'add' | translate}} + </button> + </td> + </tr> + </tbody> + </table> + </div> + + <kc-tooltip>{{:: 'authz-evaluation-contextual-attributes.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + <fieldset> + <legend><span class="text">{{:: 'authz-permissions' | translate}}</span> + <kc-tooltip>{{:: 'authz-evaluation-permissions.tooltip' | translate}}</kc-tooltip> + </legend> + <div class="form-group"> + <label class="col-md-2 control-label" for="applyResourceType">{{:: 'authz-permission-resource-apply-to-resource-type' | translate}}</label> + + <div class="col-md-6"> + <input ng-model="applyResourceType" id="applyResourceType" onoffswitch + data-ng-click="setApplyToResourceType()"/> + </div> + <kc-tooltip>{{:: 'authz-permission-resource-apply-to-resource-type.tooltip' | translate}} + </kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-hide="applyResourceType"> + <label class="col-md-2 control-label" for="reqActions">{{:: 'authz-resources' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="resourcesUiSelect" id="reqActions3" data-ng-change="resolveScopes()" data-ng-model="newResource" data-placeholder="{{:: 'authz-select-resource' | translate}}..." data-ng-required="!applyResourceType && authzRequest.resources.length == 0 && !authzRequest.entitlements" /> + </div> + <kc-tooltip>{{:: 'authz-permission-resource-resource.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="applyResourceType"> + <label class="col-md-2 control-label" for="newResource.type">{{:: 'authz-resource-type' | translate}} <span + class="required">*</span></label> + + <div class="col-md-6"> + <input class="form-control" type="text" id="newResource.type" name="newResource.type" + data-ng-model="authzRequest.resources[0].type" + data-ng-required="applyResourceType && !authzRequest.resources[0].type && !authzRequest.entitlements"> + </div> + + <kc-tooltip>{{:: 'authz-permission-resource-type.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="applyResourceType || newResource._id == null"> + <label class="col-md-2 control-label" for="newResource.scopes">{{:: 'authz-scopes' | translate}}</label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="scopesUiSelect" id="reqActions" data-ng-model="newScopes" data-placeholder="{{:: 'authz-any-scope' | translate}}..." multiple /> + </div> + + <kc-tooltip>{{:: 'authz-permission-scope-scope.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="newResource._id != null"> + <label class="col-md-2 control-label" for="newResource.scopes">{{:: 'authz-scopes' | translate}}</label> + + <div class="col-md-6"> + <select ui-select2 + id="newResource.scopes" + data-ng-model="newScopes" + data-placeholder="{{:: 'authz-any-scope' | translate}}..." multiple> + <option ng-repeat="scope in scopes" value="{{scope.name}}">{{scope.name}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-permission-scope-scope.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix block" data-ng-show="!applyResourceType"> + <label class="col-md-2 control-label" for="newRedirectUri"></label> + + <div class="col-sm-6"> + <button data-ng-click="addResource()" class="btn btn-primary">Add</button> + <table class="table table-striped table-bordered"> + <thead> + <tr> + <th>{{:: 'authz-resource' | translate}}</th> + <th>{{:: 'authz-scopes' | translate}}</th> + <th>{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr data-ng-show="!authzRequest.resources || authzRequest.resources.length == 0"> + <td colspan="3"> + {{:: 'authz-no-resources' | translate}} + </td> + </tr> + <tr ng-repeat="resource in authzRequest.resources"> + <td>{{resource.name ? resource.name : 'authz-evaluation-any-resource-with-scopes' | translate}}</td> + <td> + <span data-ng-show="!resource.scopes.length">{{:: 'authz-any-scope' | translate}}.</span> + <span data-ng-show="resource.scopes.length > 0"> + <span ng-repeat="scope in resource.scopes"> + {{scope.name ? scope.name : scope}} {{$last ? '' : ', '}} + </span> + </span> + </td> + <td class="kc-action-cell"> + <button class="btn btn-default btn-block btn-sm" + data-ng-click="removeResource($index)">{{:: 'delete' | translate}} + </button> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </fieldset> + + <div class="form-group"> + <div class="col-md-10 col-md-offset-2"> + <button kc-save data-ng-click="evaluate()">{{:: 'authz-evaluation-evaluate' | translate}}</button> + <button kc-reset data-ng-disabled="!changed">{{:: 'reset' | translate}}</button> + </div> + </div> + </fieldset> + </form> + </div> + <div data-ng-include="resultUrl" data-ng-show="showResult && !showRpt"/> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/policy/resource-server-policy-list.html b/admin/resources/partials/authz/policy/resource-server-policy-list.html new file mode 100644 index 0000000..d6f220f --- /dev/null +++ b/admin/resources/partials/authz/policy/resource-server-policy-list.html @@ -0,0 +1,117 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <ol class="breadcrumb"> + <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li> + <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> + </ol> + + <kc-tabs-resource-server></kc-tabs-resource-server> + + <table class="table table-striped table-bordered"> + <thead> + <tr> + <th class="kc-table-actions" colspan="5"> + <div class="form-inline"> + <div class="form-group"> + {{:: 'filter' | translate}}: + <div class="input-group"> + <input type="text" placeholder="{{:: 'name' | translate}}" data-ng-model="query.name" class="form-control search" onkeydown="if (event.keyCode == 13) document.getElementById('policySearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" id="policySearch" type="submit" data-ng-click="firstPage()"></i> + </div> + </div> + <div class="input-group"> + <input type="text" placeholder="{{:: 'authz-resource' | translate}}" data-ng-model="query.resource" class="form-control search" onkeydown="if (event.keyCode == 13) document.getElementById('policySearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" type="submit" data-ng-click="firstPage()"></i> + </div> + </div> + <div class="input-group"> + <input type="text" placeholder="{{:: 'authz-scope' | translate}}" data-ng-model="query.scope" class="form-control search" onkeydown="if (event.keyCode == 13) document.getElementById('policySearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" type="submit" data-ng-click="firstPage()"></i> + </div> + </div> + <div class="input-group"> + <select class="form-control search" data-ng-model="query.type" + ng-options="p.type as p.name for p in policyProviders track by p.type" data-ng-change="firstPage()"> + <option value="" selected ng-click="query.type = ''">{{:: 'authz-all-types' | translate}}</option> + </select> + </div> + </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="policies.length == 0"> + <th width="1%"></th> + <th>{{:: 'name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th width="7%">{{:: 'type' | translate}}</th> + <th width="6%" style="text-align: center;">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tfoot data-ng-show="policies && (policies.length >= query.max || query.first > 0)"> + <tr> + <td colspan="5"> + <div class="table-nav"> + <button data-ng-click="firstPage()" class="first" ng-disabled="query.first == 0">{{:: 'first-page' | translate}}</button> + <button data-ng-click="previousPage()" class="prev" ng-disabled="query.first == 0">{{:: 'previous-page' | translate}}</button> + <button data-ng-click="nextPage()" class="next" ng-disabled="policies.length < query.max">{{:: 'next-page' | translate}}</button> + </div> + </td> + </tr> + </tfoot> + <tbody> + <tr ng-repeat-start="policy in policies | filter: {name: search.name, type: search.type} | orderBy:'name'" data-ng-click="showDetails(policy, $event);" style="cursor: pointer"> + <td> + <span ng-if="!policy.details || !policy.details.loaded" class="fa fa-angle-right"></span> + <span ng-if="policy.details && policy.details.loaded" class="fa fa-angle-right fa-angle-down"></span> + </td> + <td><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/policy/{{policy.type.endsWith('.js') ? 'js': policy.type}}/{{policy.id}}">{{policy.name}}</a></td> + <td>{{policy.description}}</td> + <td>{{policy.type}}</td> + <td align="center"> + <div class="dropdown dropdown-kebab-pf"> + <button class="btn btn-default" ng-click="delete(policy);">{{:: 'delete' | translate}} + </button> + </div> + </td> + </tr> + <tr ng-if="policy.details && policy.details.loaded" ng-repeat-end=""> + <td colspan="5" style="background-color: #ffffff"> + <div class="list-group-item-container container-fluid"> + <div class="close" data-ng-click="showDetails(policy, $event);" style="padding-top: 10px"> + <span class="pficon pficon-close"></span> + </div> + <div class="row"> + <div class="col-md-12"> + <dl class="dl-horizontal"> + <dt>Dependent Policies</dt> + <dd> + <span data-ng-show="policy.dependentPolicies && !policy.dependentPolicies.length">{{:: 'authz-no-policies-available' | translate}}</span> + <span ng-repeat="dep in policy.dependentPolicies" data-ng-show="policy.dependentPolicies.length > 0"><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/{{dep.type == 'scope' || dep.type == 'resource' ? 'permission' : 'policy'}}/{{dep.type}}/{{dep.id}}">{{dep.name}}</a>{{$last ? '' : ', '}}</span> + </dd> + </dl> + </div> + </div> + </div> + </td> + </tr> + <tr data-ng-show="(policies | filter:search).length == 0"> + <td class="text-muted" colspan="3" data-ng-show="search.name">{{:: 'no-results' | translate}}</td> + <td class="text-muted" colspan="3" data-ng-hide="search.name">{{:: 'authz-no-policies-available' | translate}}</td> + </tr> + </tbody> + </table> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file |