123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571 |
- /*
- * 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.
- */
- module.requires.push('ui.ace');
- module.config(['$routeProvider', function ($routeProvider) {
- $routeProvider
- .when('/realms/:realm/authz', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-list.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- }
- },
- controller: 'ResourceServerCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/create', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- clients: function (ClientListLoader) {
- return ClientListLoader();
- }
- },
- controller: 'ResourceServerDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- clients: function (ClientListLoader) {
- return ClientListLoader();
- },
- serverInfo: function (ServerInfoLoader) {
- return ServerInfoLoader();
- }
- },
- controller: 'ResourceServerDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/export-settings', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-export-settings.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- clients: function (ClientListLoader) {
- return ClientListLoader();
- },
- serverInfo: function (ServerInfoLoader) {
- return ServerInfoLoader();
- }
- },
- controller: 'ResourceServerDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/evaluate', {
- templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-evaluate.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- clients: function (ClientListLoader) {
- return ClientListLoader();
- },
- roles: function (RoleListLoader) {
- return new RoleListLoader();
- }
- },
- controller: 'PolicyEvaluateCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/evaluate/result', {
- templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-evaluate-result.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- },
- controller: 'PolicyEvaluateCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/resource', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-resource-list.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerResourceCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/resource/create', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-resource-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerResourceDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/resource/:rsrid', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-resource-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerResourceDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/scope', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-scope-list.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerScopeCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/scope/create', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/scope/:id', {
- templateUrl: resourceUrl + '/partials/authz/resource-server-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/permission', {
- templateUrl: resourceUrl + '/partials/authz/permission/resource-server-permission-list.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPermissionCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy', {
- templateUrl: resourceUrl + '/partials/authz/policy/resource-server-policy-list.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/permission/resource/create', {
- templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-resource-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyResourceDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/permission/resource/:id', {
- templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-resource-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyResourceDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/permission/scope/create', {
- templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/permission/scope/:id', {
- templateUrl: resourceUrl + '/partials/authz/permission/provider/resource-server-policy-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/user/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-user-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyUserDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/user/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-user-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyUserDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyClientDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyClientDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/role/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-role-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyRoleDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/role/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-role-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyRoleDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/group/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-group-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyGroupDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/group/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-group-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyGroupDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/js/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-js-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- serverInfo : function(ServerInfoLoader) {
- return ServerInfoLoader();
- }
- },
- controller: 'ResourceServerPolicyJSDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/js/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-js-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- serverInfo : function(ServerInfoLoader) {
- return ServerInfoLoader();
- }
- },
- controller: 'ResourceServerPolicyJSDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/time/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-time-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyTimeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/time/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-time-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyTimeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/aggregate/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyAggregateDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/aggregate/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-aggregate-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyAggregateDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client-scope/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyClientScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/client-scope/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-client-scope-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyClientScopeDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/regex/create', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-regex-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyRegexDetailCtrl'
- }).when('/realms/:realm/clients/:client/authz/resource-server/policy/regex/:id', {
- templateUrl: resourceUrl + '/partials/authz/policy/provider/resource-server-policy-regex-detail.html',
- resolve: {
- realm: function (RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller: 'ResourceServerPolicyRegexDetailCtrl'
- }).when('/realms/:realm/roles/:role/permissions', {
- templateUrl : resourceUrl + '/partials/authz/mgmt/realm-role-permissions.html',
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- },
- role : function(RoleLoader) {
- return RoleLoader();
- }
- },
- controller : 'RealmRolePermissionsCtrl'
- }).when('/realms/:realm/clients/:client/roles/:role/permissions', {
- templateUrl : resourceUrl + '/partials/authz/mgmt/client-role-permissions.html',
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- },
- role : function(RoleLoader) {
- return RoleLoader();
- }
- },
- controller : 'ClientRolePermissionsCtrl'
- }).when('/realms/:realm/users-permissions', {
- templateUrl : resourceUrl + '/partials/authz/mgmt/users-permissions.html',
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- }
- },
- controller : 'UsersPermissionsCtrl'
- })
- .when('/realms/:realm/clients/:client/permissions', {
- templateUrl : resourceUrl + '/partials/authz/mgmt/client-permissions.html',
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- },
- client : function(ClientLoader) {
- return ClientLoader();
- }
- },
- controller : 'ClientPermissionsCtrl'
- })
- .when('/realms/:realm/groups/:group/permissions', {
- templateUrl : resourceUrl + '/partials/authz/mgmt/group-permissions.html',
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- },
- group : function(GroupLoader) {
- return GroupLoader();
- }
- },
- controller : 'GroupPermissionsCtrl'
- })
- .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias/permissions', {
- templateUrl : function(params){ return resourceUrl + '/partials/authz/mgmt/broker-permissions.html'; },
- resolve : {
- realm : function(RealmLoader) {
- return RealmLoader();
- },
- identityProvider : function(IdentityProviderLoader) {
- return IdentityProviderLoader();
- }
- },
- controller : 'IdentityProviderPermissionCtrl'
- })
- ;
- }]);
- module.directive('kcTabsResourceServer', function () {
- return {
- scope: true,
- restrict: 'E',
- replace: true,
- templateUrl: resourceUrl + '/templates/authz/kc-tabs-resource-server.html'
- }
- });
- module.filter('unique', function () {
- return function (items, filterOn) {
- if (filterOn === false) {
- return items;
- }
- if ((filterOn || angular.isUndefined(filterOn)) && angular.isArray(items)) {
- var hashCheck = {}, newItems = [];
- var extractValueToCompare = function (item) {
- if (angular.isObject(item) && angular.isString(filterOn)) {
- return item[filterOn];
- } else {
- return item;
- }
- };
- angular.forEach(items, function (item) {
- var valueToCheck, isDuplicate = false;
- for (var i = 0; i < newItems.length; i++) {
- if (angular.equals(extractValueToCompare(newItems[i]), extractValueToCompare(item))) {
- isDuplicate = true;
- break;
- }
- }
- if (!isDuplicate) {
- newItems.push(item);
- }
- });
- items = newItems;
- }
- return items;
- };
- });
- module.filter('toCamelCase', function () {
- return function (input) {
- input = input || '';
- return input.replace(/\w\S*/g, function (txt) {
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
- });
- };
- })
|