ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [12/33] ambari git commit: AMBARI-21172 - Delete view privileges from the Groups page (Anita Jebaraj via sangeetar)
Date Fri, 30 Jun 2017 09:46:28 GMT
AMBARI-21172 - Delete view privileges from the Groups page (Anita Jebaraj via sangeetar)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/86347182
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/86347182
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/86347182

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 86347182a99209dcd767240ae475a03549acd989
Parents: 3529d05
Author: Sangeeta Ravindran <sangeetar@apache.org>
Authored: Tue Jun 27 10:49:43 2017 -0700
Committer: Sangeeta Ravindran <sangeetar@apache.org>
Committed: Tue Jun 27 10:49:43 2017 -0700

----------------------------------------------------------------------
 .../scripts/controllers/groups/GroupsEditCtrl.js | 19 +++++++++++++++++--
 .../ui/admin-web/app/views/groups/edit.html      |  3 +++
 2 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/86347182/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsEditCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsEditCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsEditCtrl.js
index 92406e9..21d0fd6 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsEditCtrl.js
@@ -129,6 +129,20 @@ angular.module('ambariAdminConsole')
     });
   };
 
+
+  $scope.removePrivilege = function(name, privilege) {
+    var privilegeObject = {
+        id: privilege.privilege_id,
+        view_name: privilege.view_name,
+        version: privilege.version,
+        instance_name: name
+    };
+    View.deletePrivilege(privilegeObject).then(function() {
+      loadPrivileges();
+    });
+  };
+
+function loadPrivileges() {
   // Load privileges
   Group.getPrivileges($routeParams.id).then(function(data) {
     var privileges = {
@@ -145,6 +159,7 @@ angular.module('ambariAdminConsole')
         privileges.views[privilege.instance_name] = privileges.views[privilege.instance_name]
|| { privileges:[]};
         privileges.views[privilege.instance_name].version = privilege.version;
         privileges.views[privilege.instance_name].view_name = privilege.view_name;
+        privileges.views[privilege.instance_name].privilege_id = privilege.privilege_id;
         privileges.views[privilege.instance_name].privileges.push(privilege.permission_label);
       }
     });
@@ -157,6 +172,6 @@ angular.module('ambariAdminConsole')
   }).catch(function(data) {
     Alert.error($t('common.alerts.cannotLoadPrivileges'), data.data.message);
   });
-
-
+}
+loadPrivileges();
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86347182/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html
index e472ede..1aafd03 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/groups/edit.html
@@ -83,6 +83,9 @@
               <td>
                 <span tooltip="{{item}}" ng-repeat="item in privilege.privileges">{{item
| translate}}{{$last ? '' : ', '}}</span>
               </td>
+              <td>
+                <i class="fa fa-trash-o" aria-hidden="true" ng-click="removePrivilege(name,
privilege);"></i>
+              </td>
             </tr>
             <tr>
               <td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate:
'{term: constants.view}'}}</td>


Mime
View raw message