ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-21130 Delete view privileges from the Users page (Anita Jebaraj via dili)
Date Thu, 01 Jun 2017 20:14:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk dfb5d3920 -> 49605daef


AMBARI-21130 Delete view privileges from the Users page (Anita Jebaraj via dili)


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

Branch: refs/heads/trunk
Commit: 49605daef3f5404b6be59a051c268b56cb81b291
Parents: dfb5d39
Author: Di Li <dili@apache.org>
Authored: Thu Jun 1 16:14:27 2017 -0400
Committer: Di Li <dili@apache.org>
Committed: Thu Jun 1 16:14:27 2017 -0400

----------------------------------------------------------------------
 .../app/scripts/controllers/users/UsersShowCtrl.js     | 13 +++++++++++++
 .../resources/ui/admin-web/app/views/users/show.html   |  5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/49605dae/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
index 0706620..200872e 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
@@ -184,6 +184,18 @@ 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();
+    });
+  };
+
   $scope.deleteUser = function() {
     ConfirmationModal.show(
       $t('common.delete', {
@@ -257,6 +269,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;
           if (privileges.views[privilege.instance_name].privileges.indexOf(privilege.permission_label)
== -1) {
             privileges.views[privilege.instance_name].privileges.push(privilege.permission_label);
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/49605dae/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
index 7abdf05..f965c5d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
@@ -105,6 +105,9 @@
               <td>
                 <span tooltip="{{item}}" ng-repeat="item in privilege.privileges track
by $index">{{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>
@@ -116,4 +119,4 @@
       </div>
     </div>
   </form>
-</div>
\ No newline at end of file
+</div>


Mime
View raw message