2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 app.controller('policyRolesController', function ($scope, PolicyAppService, modalService, $modal, Notification){
21 $( "#dialog" ).hide();
23 $scope.isDisabled = true;
25 PolicyAppService.getData('get_LockDownData').then(function(data){
27 $scope.data = JSON.parse(j.data);
28 $scope.lockdowndata = JSON.parse($scope.data.lockdowndata);
29 if($scope.lockdowndata[0].lockdown == true){
30 $scope.isDisabled = true;
32 $scope.isDisabled = false;
34 console.log($scope.data);
36 console.log("failed");
39 $scope.scopeDatas = [];
40 PolicyAppService.getData('get_RolesData').then(function (data) {
42 $scope.data = JSON.parse(j.data);
43 console.log($scope.data);
44 $scope.rolesDatas = JSON.parse($scope.data.rolesDatas);
45 console.log($scope.rolesDatas);
47 console.log("failed");
50 $scope.rolesTableGrid = {
52 enableFiltering: true,
54 field: 'id', enableFiltering: false,
56 '<button type="button" class="btn btn-primary" ng-click="grid.appScope.editRolesWindow(row.entity)"><i class="fa fa-pencil-square-o"></i></button>' , width: '4%'
58 { field: 'loginId.userName', displayName : 'Name', sort: { direction: 'asc', priority: 0 }},
59 { field: 'scope', displayName : 'Scope' },
60 { field: 'role', displayName : 'Role' }
65 $scope.editRoleName = null;
67 $scope.editRolesWindow = function(editRoleData) {
68 if($scope.lockdowndata[0].lockdown == true){
69 Notification.error("Policy Application has been Locked")
71 $scope.editRoleName = editRoleData;
72 var modalInstance = $modal.open({
73 backdrop: 'static', keyboard: false,
74 templateUrl : 'edit_Role_popup.html',
75 controller: 'editRoleController',
77 message: function () {
79 editRoleData: $scope.editRoleName
85 modalInstance.result.then(function(response){
86 console.log('response', response);