diff options
Diffstat (limited to 'admin/resources/partials/authz')
26 files changed, 2471 insertions, 0 deletions
diff --git a/admin/resources/partials/authz/mgmt/broker-permissions.html b/admin/resources/partials/authz/mgmt/broker-permissions.html new file mode 100644 index 0000000..2e389ff --- /dev/null +++ b/admin/resources/partials/authz/mgmt/broker-permissions.html @@ -0,0 +1,40 @@ +<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}}/identity-provider-settings">{{:: 'identity-providers' | translate}}</a></li> + <li data-ng-show="!newIdentityProvider && identityProvider.displayName">{{identityProvider.displayName}}</li> + <li data-ng-show="!newIdentityProvider && !identityProvider.displayName">{{identityProvider.alias}}</li> + </ol> + + <kc-tabs-identity-provider></kc-tabs-identity-provider> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!access.manageIdentityProviders || !access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-idp-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/mgmt/client-permissions.html b/admin/resources/partials/authz/mgmt/client-permissions.html new file mode 100644 index 0000000..7f29fd7 --- /dev/null +++ b/admin/resources/partials/authz/mgmt/client-permissions.html @@ -0,0 +1,39 @@ +<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>{{client.clientId}}</li> + </ol> + + <kc-tabs-client></kc-tabs-client> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!client.access.manage || !access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-client-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/mgmt/client-role-permissions.html b/admin/resources/partials/authz/mgmt/client-role-permissions.html new file mode 100644 index 0000000..c76ecec --- /dev/null +++ b/admin/resources/partials/authz/mgmt/client-role-permissions.html @@ -0,0 +1,40 @@ +<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>{{role.name}}</li> + </ol> + + <kc-tabs-client-role></kc-tabs-client-role> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!client.access.manage || !access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-role-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/mgmt/group-permissions.html b/admin/resources/partials/authz/mgmt/group-permissions.html new file mode 100644 index 0000000..f2be6d9 --- /dev/null +++ b/admin/resources/partials/authz/mgmt/group-permissions.html @@ -0,0 +1,39 @@ +<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}}/groups">{{:: 'groups' | translate}}</a></li> + <li>{{group.name}}</li> + </ol> + + <kc-tabs-group></kc-tabs-group> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!group.access.manage || !access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-group-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/mgmt/realm-role-permissions.html b/admin/resources/partials/authz/mgmt/realm-role-permissions.html new file mode 100644 index 0000000..e21ee63 --- /dev/null +++ b/admin/resources/partials/authz/mgmt/realm-role-permissions.html @@ -0,0 +1,39 @@ +<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}}/roles">{{:: 'roles' | translate}}</a></li> + <li>{{role.name}}</li> + </ol> + + <kc-tabs-role></kc-tabs-role> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-role' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-role.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-role-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/mgmt/users-permissions.html b/admin/resources/partials/authz/mgmt/users-permissions.html new file mode 100644 index 0000000..2665bba --- /dev/null +++ b/admin/resources/partials/authz/mgmt/users-permissions.html @@ -0,0 +1,35 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + + <kc-tabs-users></kc-tabs-users> + + <form class=form-horizontal" name="enableForm" novalidate kc-read-only="!access.manageAuthorization"> + <fieldset class="border-top"> + <div class="form-group"> + <label class="col-md-2 control-label" for="permissionsEnabled">{{:: 'permissions-enabled-users' | translate}}</label> + <div class="col-md-6"> + <input ng-model="permissions.enabled" name="permissionsEnabled" id="permissionsEnabled" ng-disabled="!access.manageAuthorization" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/> + </div> + <kc-tooltip>{{:: 'permissions-enabled-users.tooltip' | translate}}</kc-tooltip> + </div> + </fieldset> + </form> + <table class="datatable table table-striped table-bordered dataTable no-footer" data-ng-show="permissions.enabled"> + <thead> + <tr> + <th>{{:: 'scope-name' | translate}}</th> + <th>{{:: 'description' | translate}}</th> + <th colspan="2">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="(scopeName, scopeId) in permissions.scopePermissions"> + <td><a href="#/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{scopeName}}</a></td> + <td translate="{{scopeName}}-authz-users-scope-description"></td> + <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/clients/{{realmManagementClientId}}/authz/resource-server/permission/scope/{{scopeId}}">{{:: 'edit' | translate}}</td> + </tr> + </tbody> + </table> + +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html b/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html new file mode 100644 index 0000000..af5aace --- /dev/null +++ b/admin/resources/partials/authz/permission/provider/resource-server-policy-resource-detail.html @@ -0,0 +1,131 @@ +<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/permission">{{:: 'authz-permissions' | translate}}</a></li> + <li data-ng-show="create">{{:: 'authz-add-resource-permission' | translate}}</li> + <li data-ng-hide="create">{{originalPolicy.name}}</li> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-resource-permission' | 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-permission-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-permission-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="applyToResourceTypeFlag">{{:: 'authz-permission-resource-apply-to-resource-type' | translate}}</label> + <div class="col-md-6"> + <input ng-model="applyToResourceTypeFlag" id="applyToResourceTypeFlag" onoffswitch data-ng-click="applyToResourceType()"/> + </div> + <kc-tooltip>{{:: 'authz-permission-resource-apply-to-resource-type.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-hide="applyToResourceTypeFlag"> + <label class="col-md-2 control-label" for="resources">{{:: 'authz-resources' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="resourcesUiSelect" id="resources" data-ng-model="selectedResource" data-placeholder="{{:: 'authz-select-resource' | translate}}..." data-ng-required="!applyToResourceTypeFlag"/> + </div> + <kc-tooltip>{{:: 'authz-permission-resource-resource.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="applyToResourceTypeFlag"> + <label class="col-md-2 control-label" for="resourceType">{{:: 'authz-resource-type' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input class="form-control" type="text" id="resourceType" name="policy.resourceType" data-ng-model="policy.resourceType" data-ng-required="applyToResourceTypeFlag"> + </div> + + <kc-tooltip>{{:: 'authz-permission-resource-type.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}}</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}}..."/> + </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="decisionStrategy">{{:: 'authz-policy-decision-strategy' | translate}}</label> + + <div class="col-sm-2"> + <select class="form-control" id="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> + <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/permission/provider/resource-server-policy-scope-detail.html b/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html new file mode 100644 index 0000000..17ee7cb --- /dev/null +++ b/admin/resources/partials/authz/permission/provider/resource-server-policy-scope-detail.html @@ -0,0 +1,134 @@ +<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/permission">{{:: 'authz-permissions' | translate}}</a></li> + <li data-ng-show="create">{{:: 'authz-add-scope-permission' | translate}}</li> + <li data-ng-hide="create">{{originalPolicy.name}}</li> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-scope-permission' | 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-permission-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-permission-description.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="resources">{{:: 'authz-resource' | translate}}</label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="resourcesUiSelect" data-ng-change="selectResource()" id="resources" data-ng-model="selectedResource" data-placeholder="{{:: 'authz-any-resource' | translate}}..." /> + </div> + <kc-tooltip>{{:: 'authz-permission-scope-resource.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="selectedResource"> + <label class="col-md-2 control-label" for="resourceScopes">{{:: 'authz-scopes' | translate}} <span class="required">*</span></label> + <div class="col-md-6"> + <select ui-select2 id="resourceScopes" + data-ng-model="selectedScopes" + data-placeholder="{{:: 'authz-any-scope' | translate}}..." multiple + data-ng-required="selectedResource != null"> + <option ng-repeat="scope in resourceScopes" value="{{scope.id}}">{{scope.name}}</option> + </select> + </div> + <kc-tooltip>{{:: 'authz-permission-scope-scope.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix" data-ng-show="!selectedResource"> + <label class="col-md-2 control-label" for="scopes">{{:: 'authz-scopes' | translate}} <span class="required">*</span></label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="scopesUiSelect" id="scopes" data-ng-model="selectedScopes" data-placeholder="{{:: 'authz-any-scope' | translate}}..." multiple data-ng-required="selectedResource == null" /> + </div> + <kc-tooltip>{{:: 'authz-permission-scope-scope.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="policies">{{:: 'authz-policy-apply-policy' | translate}}</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}}..."/> + </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="decisionStrategy">{{:: 'authz-policy-decision-strategy' | translate}}</label> + + <div class="col-sm-2"> + <select class="form-control" id="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> + <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/permission/resource-server-permission-list.html b/admin/resources/partials/authz/permission/resource-server-permission-list.html new file mode 100644 index 0000000..40dfacd --- /dev/null +++ b/admin/resources/partials/authz/permission/resource-server-permission-list.html @@ -0,0 +1,118 @@ +<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/permission">{{:: 'authz-permissions' | 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 group by p.group 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 class="form-control" ng-model="policyType" + ng-options="p.name for p in policyProviders track by p.type" + id="create-permission" + data-ng-change="addPolicy(policyType);"> + <option value="" disabled selected>{{:: 'authz-create-permission' | 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/permission/{{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>{{:: 'authz-associated-policies' | translate}}</dt> + <dd> + <span data-ng-show="policy.associatedPolicies && !policy.associatedPolicies.length">{{:: 'authz-no-policies-available' | translate}}</span> + <span ng-repeat="dep in policy.associatedPolicies" data-ng-show="policy.associatedPolicies.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-permissions-available' | translate}}</td> + </tr> + </tbody> + </table> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file 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 diff --git a/admin/resources/partials/authz/resource-server-detail.html b/admin/resources/partials/authz/resource-server-detail.html new file mode 100644 index 0000000..5bf7d88 --- /dev/null +++ b/admin/resources/partials/authz/resource-server-detail.html @@ -0,0 +1,77 @@ +<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">{{:: 'settings' | translate}}</a></li> + </ol> + + <kc-tabs-resource-server></kc-tabs-resource-server> + + <form class="form-horizontal" name="clientForm" novalidate> + <fieldset> + <div class="form-group"> + <label for="import-file" class="col-sm-2 control-label">{{:: 'import' | translate}}</label> + <div class="col-md-6"> + <div class="controls kc-button-input-file" data-ng-show="!importing"> + <label for="import-file" class="btn btn-default">{{:: 'select-file' | translate}} <i class="pficon pficon-import"></i></label> + <input id="import-file" type="file" class="hidden" kc-on-read-file="onFileSelect($fileContent)"> + </div> + <div class="col-md-6" data-ng-show="importing"> + <input type="button" class="btn btn-default" data-ng-click="viewImportDetails()" value="{{:: 'view-details' | translate}}"/> + </div> + </div> + <kc-tooltip>{{:: 'authz-import-config.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <div class="col-md-10 col-md-offset-2" data-ng-show="importing"> + <button class="btn btn-default" data-ng-click="import()" data-ng-disabled="!changed">Import</button> + <button kc-cancel data-ng-click="reset()">Cancel</button> + </div> + </div> + </fieldset> + <fieldset class="border-top" data-ng-hide="importing"> + <div class="form-group"> + <label class="col-md-2 control-label" for="server.policyEnforcementMode">{{:: 'authz-policy-enforcement-mode' | translate}}</label> + <div class="col-md-2"> + <select class="form-control" id="server.policyEnforcementMode" data-ng-model="server.policyEnforcementMode"> + <option value="ENFORCING">{{:: 'authz-policy-enforcement-mode-enforcing' | translate}}</option> + <option value="PERMISSIVE">{{:: 'authz-policy-enforcement-mode-permissive' | translate}}</option> + <option value="DISABLED">{{:: 'authz-policy-enforcement-mode-disabled' | translate}}</option> + </select> + </div> + <kc-tooltip>{{:: 'authz-policy-enforcement-mode.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="server.decisionStrategy">{{:: 'authz-policy-decision-strategy' | translate}}</label> + + <div class="col-sm-2"> + <select class="form-control" id="server.decisionStrategy" + data-ng-model="server.decisionStrategy" + ng-change="selectDecisionStrategy()"> + <option value="UNANIMOUS">{{:: 'authz-policy-decision-strategy-unanimous' | translate}}</option> + <option value="AFFIRMATIVE">{{:: 'authz-policy-decision-strategy-affirmative' | translate}}</option> + </select> + </div> + + <kc-tooltip>{{:: 'authz-server-decision-strategy.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="server.allowRemoteResourceManagement">{{:: 'authz-remote-resource-management' | translate}}</label> + <div class="col-md-6"> + <input ng-model="server.allowRemoteResourceManagement" id="server.allowRemoteResourceManagement" onoffswitch /> + </div> + <kc-tooltip>{{:: 'authz-remote-resource-management.tooltip' | translate}}</kc-tooltip> + </div> + <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> + </fieldset> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/resource-server-export-settings.html b/admin/resources/partials/authz/resource-server-export-settings.html new file mode 100644 index 0000000..86505db --- /dev/null +++ b/admin/resources/partials/authz/resource-server-export-settings.html @@ -0,0 +1,35 @@ +<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">{{:: 'export-settings' | translate}}</a></li> + </ol> + + <kc-tabs-resource-server></kc-tabs-resource-server> + + <form class="form-horizontal" name="exportForm" novalidate> + <fieldset> + <div class="form-group"> + <label class="col-md-2 control-label">{{:: 'authz-export-settings' | translate}}</label> + <div class="col-md-6"> + <button data-ng-click="export()" class="btn btn-primary" data-ng-hide="settings">{{:: 'export' | translate}}</button> + <button data-ng-click="downloadSettings()" class="btn btn-primary" data-ng-show="settings">{{:: 'download' | translate}}</button> + <button data-ng-click="cancelExport()" class="btn btn-primary" data-ng-show="settings">{{:: 'cancel' | translate}}</button> + </div> + <kc-tooltip>{{:: 'authz-export-settings.tooltip' | translate}}</kc-tooltip> + </div> + <fieldset class="margin-top"> + <div class="form-group" ng-show="settings"> + <div class="col-sm-12"> + <a class="btn btn-primary btn-lg" data-ng-click="download()" type="submit" ng-show="installation">{{:: 'download' | translate}}</a> + <textarea class="form-control" rows="20" kc-select-action="click">{{settings}}</textarea> + </div> + </div> + </fieldset> + </fieldset> + </form> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/resource-server-list.html b/admin/resources/partials/authz/resource-server-list.html new file mode 100644 index 0000000..3b4130e --- /dev/null +++ b/admin/resources/partials/authz/resource-server-list.html @@ -0,0 +1,49 @@ +<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2"> + <h1> + <span>Resource Servers</span> + <kc-tooltip>Resource Servers are applications serving resources to their users. These resources can be a RESTFul API, web pages or any other kind of resource that must be managed and protected by a set of authorization policies.</kc-tooltip> + </h1> + + <table class="table table-striped table-bordered"> + <thead> + <tr> + <th class="kc-table-actions" colspan="5"> + <div class="form-inline"> + <div class="form-group"> + <div class="input-group"> + <input type="text" placeholder="Search..." data-ng-model="search.clientId" class="form-control search" onkeyup="if(event.keyCode == 13){$(this).next('I').click();}"> + <div class="input-group-addon"> + <i class="fa fa-search" type="submit"></i> + </div> + </div> + </div> + + <div class="pull-right"> + <a id="createServer" class="btn btn-default" href="#/realms/{{realm.realm}}/authz/resource-server/create">Create</a> + </div> + </div> + </th> + </tr> + <tr data-ng-hide="servers.length == 0"> + <th>Name</th> + <th>Policy Enforcement Mode</th> + <th>Allows Remote Resource Management ?</th> + <th>Allows Entitlement ?</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="server in servers | filter:search | orderBy:'clientId'"> + <td><a href="#/realms/{{realm.realm}}/authz/resource-server/{{server.id}}">{{server.name}}</a></td> + <td>{{server.policyEnforcementMode | toCamelCase}}</td> + <td>{{server.allowRemoteResourceManagement}}</td> + <td>{{server.allowEntitlements}}</td> + </tr> + <tr data-ng-show="(servers | filter:search).length == 0"> + <td class="text-muted" colspan="3" data-ng-show="search.clientId">No results</td> + <td class="text-muted" colspan="3" data-ng-hide="search.clientId">No servers available</td> + </tr> + </tbody> + </table> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file diff --git a/admin/resources/partials/authz/resource-server-resource-detail.html b/admin/resources/partials/authz/resource-server-resource-detail.html new file mode 100644 index 0000000..b3d6eca --- /dev/null +++ b/admin/resources/partials/authz/resource-server-resource-detail.html @@ -0,0 +1,126 @@ +<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/resource">{{:: 'authz-resources' | translate}}</a></li> + <li data-ng-show="create">{{:: 'authz-add-resource' | translate}}</li> + <li data-ng-hide="create">{{originalResource.name}}</li> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-resource' | translate}}</h1> + <h1 data-ng-hide="create">{{originalResource.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" data-ng-show="create">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="resource.name" autofocus required data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-resource-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'displayName' | translate}} <span class="required" data-ng-show="create">*</span></label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="displayName" name="displayName" data-ng-model="resource.displayName"> + </div> + <kc-tooltip>{{:: 'authz-resource-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group" data-ng-hide="create"> + <label class="col-md-2 control-label" for="resource.owner.name">{{:: 'authz-owner' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="resource.owner.name" name="name" data-ng-model="resource.owner.name" autofocus disabled> + </div> + <kc-tooltip>{{:: 'authz-resource-owner.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="type">{{:: 'type' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="type" name="name" data-ng-model="resource.type" autofocus> + </div> + <kc-tooltip>{{:: 'authz-resource-type.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="newUri">{{:: 'authz-uri' | translate}} </label> + <div class="col-sm-6"> + <div class="input-group" ng-repeat="(i, uri) in resource.uris track by $index"> + <input class="form-control" ng-model="resource.uris[i]"> + <div class="input-group-btn"> + <button class="btn btn-default" type="button" data-ng-click="deleteUri($index)"><span class="fa fa-minus"></span></button> + </div> + </div> + + <div class="input-group"> + <input class="form-control" ng-model="newUri" id="newUri"> + <div class="input-group-btn"> + <button class="btn btn-default" type="button" data-ng-click="newUri.length > 0 && addUri()"><span class="fa fa-plus"></span></button> + </div> + </div> + </div> + <kc-tooltip>{{:: 'authz-resource-uri.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group clearfix"> + <label class="col-md-2 control-label" for="scopes">{{:: 'authz-scopes' | translate}}</label> + + <div class="col-md-6"> + <input type="hidden" ui-select2="scopesUiSelect" id="scopes" data-ng-model="resource.scopes" data-placeholder="{{:: 'authz-select-scope' | translate}}..." multiple/> + </div> + + <kc-tooltip>{{:: 'authz-resource-scopes.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="iconUri">{{:: 'authz-icon-uri' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="iconUri" name="name" data-ng-model="resource.icon_uri" autofocus> + </div> + <kc-tooltip>{{:: 'authz-icon-uri.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="resource.ownerManagedAccess">{{:: 'authz-resource-user-managed-access-enabled' | translate}}</label> + <div class="col-md-6"> + <input ng-model="resource.ownerManagedAccess" id="resource.ownerManagedAccess" onoffswitch /> + </div> + <kc-tooltip>{{:: 'authz-resource-user-managed-access-enabled.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label">{{:: 'authz-resource-attributes' | translate}}</label> + <div class="col-md-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 resource.attributes | toOrderedMapSortedByKey"> + <td>{{key}}</td> + <td><input ng-model="resource.attributes[key]" class="form-control" type="text" name="{{key}}" id="attribute-{{key}}" /></td> + <td class="kc-action-cell" id="removeAttribute" data-ng-click="removeAttribute(key)">{{:: 'delete' | translate}}</td> + </tr> + <tr> + <td><input ng-model="newAttribute.key" class="form-control" type="text" id="newAttributeKey" /></td> + <td><input ng-model="newAttribute.value" class="form-control" type="text" id="newAttributeValue" /></td> + <td class="kc-action-cell" id="addAttribute" data-ng-click="addAttribute()" data-ng-disabled="!newAttribute.key.length || !newAttribute.value.length">{{:: 'add' | translate}}</td> + </tr> + </tbody> + </table> + </div> + <kc-tooltip>{{:: 'authz-resource-attributes.tooltip' | translate}}</kc-tooltip> + </div> + </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/resource-server-resource-list.html b/admin/resources/partials/authz/resource-server-resource-list.html new file mode 100644 index 0000000..dce000e --- /dev/null +++ b/admin/resources/partials/authz/resource-server-resource-list.html @@ -0,0 +1,169 @@ +<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/resource">{{:: + 'authz-resources' | 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="6"> + <div class="form-inline"> + {{:: 'filter' | translate}}: + <div class="form-group"> + <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('resourceSearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" id="resourceSearch" type="submit" + data-ng-click="firstPage()"></i> + </div> + </div> + <div class="input-group"> + <input type="text" placeholder="{{:: 'type' | translate}}" data-ng-model="query.type" + class="form-control search" + onkeydown="if (event.keyCode == 13) document.getElementById('resourceSearch').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-uri' | translate}}" data-ng-model="query.uri" + class="form-control search" + onkeydown="if (event.keyCode == 13) document.getElementById('resourceSearch').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-owner' | translate}}" + data-ng-model="query.owner" class="form-control search" + onkeydown="if (event.keyCode == 13) document.getElementById('resourceSearch').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('resourceSearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" type="submit" data-ng-click="firstPage()"></i> + </div> + </div> + </div> + <div class="pull-right"> + <a id="createResource" class="btn btn-default" + href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/resource/create">{{:: + 'create' | translate}}</a> + </div> + </div> + </th> + </tr> + <tr data-ng-hide="resources.length == 0"> + <th width="1%"></th> + <th>{{:: 'name' | translate}}</th> + <th>{{:: 'type' | translate}}</th> + <th>{{:: 'authz-uris' | translate}}</th> + <th>{{:: 'authz-owner' | translate}}</th> + <th width="11%" style="text-align: center">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tfoot data-ng-show="resources && (resources.length >= query.max || query.first > 0)"> + <tr> + <td colspan="6"> + <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="resources.length < query.max">{{:: + 'next-page' | translate}} + </button> + </div> + </td> + </tr> + </tfoot> + <tbody> + <tr ng-repeat-start="resource in resources | filter:search | orderBy:'name'" data-ng-click="showDetails(resource, $event);" style="cursor: pointer;"> + <td> + <span ng-if="!resource.details || !resource.details.loaded" class="fa fa-angle-right"></span> + <span ng-if="resource.details && resource.details.loaded" class="fa fa-angle-right fa-angle-down"></span> + </td> + <td> + <a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/resource/{{resource._id}}">{{resource.name}}</a> + </td> + <td> + <span data-ng-show="resource.type">{{resource.type}}</span> + <span data-ng-show="!resource.type">{{:: 'authz-no-type-defined' | translate}}</span> + </td> + <td> + <span data-ng-show="resource.uris.length == 0">{{:: 'authz-no-uri-defined' | translate}}</span> + <span data-ng-show="resource.uris.length == 1">{{resource.uris[0]}}</span> + <span data-ng-show="resource.uris.length > 1">{{resource.uris.length}} {{:: 'authz-uris' | translate}}</span> + </td> + <td>{{resource.owner.name}}</td> + <td align="center"> + <div class="dropdown dropdown-kebab-pf"> + <button class="btn btn-default" ng-click="createPolicy(resource);">{{:: 'authz-create-permission' | translate}} + </button> + <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" + aria-haspopup="true" aria-expanded="true"> + <span class="fa fa-ellipsis-v"></span></button> + <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownKebabRight"> + <li><a href="" ng-click="delete(resource);">{{:: 'delete' | translate}}</a></li> + </ul> + </div> + </td> + </tr> + <tr ng-if="resource.details && resource.details.loaded" ng-repeat-end=""> + <td colspan="6" style="background-color: #ffffff"> + <div class="list-group-item-container container-fluid"> + <div class="close" data-ng-click="showDetails(resource, $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>{{:: 'authz-scopes' | translate}}</dt> + <dd> + <span data-ng-show="resource.scopes && !resource.scopes.length">{{:: 'authz-no-scopes-assigned' | translate}}</span> + <span ng-repeat="scope in resource.scopes" data-ng-show="resource.scopes.length > 0"><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/scope/{{scope.id}}">{{scope.name}}</a>{{$last ? '' : ', '}} </span> + </dd> + <dt>{{:: 'authz-associated-permissions' | translate}}</dt> + <dd> + <span data-ng-show="resource.policies && !resource.policies.length">{{:: 'authz-no-permission-assigned' | translate}}</span> + <span ng-repeat="policy in resource.policies" data-ng-show="resource.policies.length > 0"><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/permission/{{policy.type}}/{{policy.id}}">{{policy.name}}</a>{{$last ? '' : ', '}}</span> + </dd> + <dt>{{:: 'authz-uris' | translate}}</dt> + <dd> + <span data-ng-show="resource.uris && !resource.uris.length">{{:: 'authz-no-uri-defined' | translate}}</span> + <span ng-repeat="uri in resource.uris" data-ng-show="resource.uris.length > 0">{{uri}}{{$last ? '' : ', '}}</span> + </dd> + </dl> + </div> + </div> + </div> + </td> + </tr> + <tr data-ng-show="(resources | filter:search).length == 0"> + <td class="text-muted" colspan="6" data-ng-show="search.name">{{:: 'no-results' | translate}}</td> + <td class="text-muted" colspan="6" data-ng-hide="search.name">{{:: 'authz-no-resources-available' | + translate}} + </td> + </tr> + </tbody> + </table> +</div> + +<kc-menu></kc-menu> diff --git a/admin/resources/partials/authz/resource-server-scope-detail.html b/admin/resources/partials/authz/resource-server-scope-detail.html new file mode 100644 index 0000000..d296abd --- /dev/null +++ b/admin/resources/partials/authz/resource-server-scope-detail.html @@ -0,0 +1,50 @@ +<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/scope">{{:: 'authz-scopes' | translate}}</a></li> + <li data-ng-show="create">{{:: 'authz-add-scope' | translate}}</li> + <li data-ng-hide="create">{{originalScope.name}}</li> + </ol> + + <h1 data-ng-show="create">{{:: 'authz-add-scope' | translate}}</h1> + <h1 data-ng-hide="create">{{originalScope.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create" + data-ng-hide="changed" 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}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="name" name="name" data-ng-model="scope.name" autofocus data-ng-blur="checkNewNameAvailability()"> + </div> + <kc-tooltip>{{:: 'authz-scope-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="displayName">{{:: 'displayName' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="displayName" name="displayName" data-ng-model="scope.displayName"> + </div> + <kc-tooltip>{{:: 'authz-scope-name.tooltip' | translate}}</kc-tooltip> + </div> + <div class="form-group"> + <label class="col-md-2 control-label" for="name">{{:: 'authz-icon-uri' | translate}} </label> + <div class="col-sm-6"> + <input class="form-control" type="text" id="iconUri" name="name" data-ng-model="scope.iconUri" autofocus> + </div> + <kc-tooltip>{{:: 'authz-icon-uri.tooltip' | translate}}</kc-tooltip> + </div> + </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/resource-server-scope-list.html b/admin/resources/partials/authz/resource-server-scope-list.html new file mode 100644 index 0000000..22c7f38 --- /dev/null +++ b/admin/resources/partials/authz/resource-server-scope-list.html @@ -0,0 +1,102 @@ +<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/scope">{{:: 'authz-scopes' | 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="3"> + <div class="form-inline"> + <div class="form-group"> + <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('scopeSearch').click()"> + <div class="input-group-addon"> + <i class="fa fa-search" id="scopeSearch" type="submit" data-ng-click="firstPage()"></i> + </div> + </div> + </div> + <div class="pull-right"> + <a id="createScope" class="btn btn-default" href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/scope/create">{{:: 'create' | translate}}</a> + </div> + </div> + </th> + </tr> + <tr data-ng-hide="scopes.length == 0"> + <th width="1%"></th> + <th>{{:: 'name' | translate}}</th> + <th width="11%" style="text-align: center">{{:: 'actions' | translate}}</th> + </tr> + </thead> + <tfoot data-ng-show="scopes && (scopes.length >= query.max || query.first > 0)"> + <tr> + <td colspan="3"> + <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="scopes.length < query.max">{{:: 'next-page' | translate}}</button> + </div> + </td> + </tr> + </tfoot> + <tbody> + <tr ng-repeat-start="scope in scopes | filter:search | orderBy:'name'" data-ng-click="showDetails(scope, $event);" style="cursor: pointer"> + <td> + <span ng-if="!scope.details || !scope.details.loaded" class="fa fa-angle-right"></span> + <span ng-if="scope.details && scope.details.loaded" class="fa fa-angle-right fa-angle-down"></span> + </td> + <td><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/scope/{{scope.id}}">{{scope.name}}</a></td> + <td align="center"> + <div class="dropdown dropdown-kebab-pf"> + <button class="btn btn-default" ng-click="createPolicy(scope);">{{:: 'authz-create-permission' | + translate}} + </button> + <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" + aria-haspopup="true" aria-expanded="true"> + <span class="fa fa-ellipsis-v"></span></button> + <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownKebabRight"> + <li><a href="" ng-click="delete(scope);">{{:: 'delete' | translate}}</a></li> + </ul> + </div> + </td> + </tr> + <tr ng-if="scope.details && scope.details.loaded" ng-repeat-end=""> + <td colspan="3" style="background-color: #ffffff"> + <div class="list-group-item-container container-fluid"> + <div class="close" data-ng-click="showDetails(scope, $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>{{:: 'authz-resources' | translate}}</dt> + <dd> + <span data-ng-show="scope.resources && !scope.resources.length">{{:: 'authz-no-resources-assigned' | translate}}</span> + <span ng-repeat="resource in scope.resources" data-ng-show="scope.resources.length > 0"><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/resource/{{resource._id}}">{{resource.name}}</a>{{$last ? '' : ', '}}</span> + </dd> + <dt>{{:: 'authz-associated-permissions' | translate}}</dt> + <dd> + <span data-ng-show="scope.policies && !scope.policies.length">{{:: 'authz-no-permission-assigned' | translate}}</span> + <span ng-repeat="policy in scope.policies" data-ng-show="scope.policies.length > 0"><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/permission/{{policy.type}}/{{policy.id}}">{{policy.name}}</a>{{$last ? '' : ', '}}</span> + </dd> + </dl> + </div> + </div> + </div> + </td> + </tr> + <tr data-ng-show="(scopes | 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-scopes-available' | translate}}</td> + </tr> + </tbody> + </table> +</div> + +<kc-menu></kc-menu>
\ No newline at end of file |