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=========================================================
24 app.controller('policyRolesController', function ($scope, RolesTabService,modalService, $modal, AdminTabService, Notification){
25 $( "#dialog" ).hide();
27 $scope.isDisabled = true;
28 AdminTabService.getData().then(function(data){
30 $scope.data = JSON.parse(j.data);
31 $scope.lockdowndata = JSON.parse($scope.data.lockdowndata);
32 if($scope.lockdowndata[0].lockdown == true){
33 $scope.isDisabled = true;
35 $scope.isDisabled = false;
37 console.log($scope.data);
39 console.log("failed");
42 $scope.scopeDatas = [];
43 RolesTabService.getRolesData().then(function (data) {
45 $scope.data = JSON.parse(j.data);
46 console.log($scope.data);
47 $scope.rolesDatas = JSON.parse($scope.data.rolesDatas);
48 console.log($scope.rolesDatas);
50 console.log("failed");
53 $scope.rolesTableGrid = {
55 enableFiltering: true,
57 field: 'id', enableFiltering: false,
59 '<button type="button" class="btn btn-primary" ng-click="grid.appScope.editRolesWindow(row.entity)"><i class="fa fa-pencil-square-o"></i></button>', width: '8%'
61 { field: 'loginId.userName', displayName : 'Name'},
62 { field: 'scope', displayName : 'Scope' },
63 { field: 'role', displayName : 'Role' }
68 $scope.editRoleName = null;
70 $scope.editRolesWindow = function(editRoleData) {
71 if($scope.lockdowndata[0].lockdown == true){
72 Notification.error("Policy Application has been Locked")
74 $scope.editRoleName = editRoleData;
75 var modalInstance = $modal.open({
76 backdrop: 'static', keyboard: false,
77 templateUrl : 'edit_Role_popup.html',
78 controller: 'editRoleController',
80 message: function () {
82 editRoleData: $scope.editRoleName
88 modalInstance.result.then(function(response){
89 console.log('response', response);