[pve-devel] r5607 - pve-manager/pve2/www/manager

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Feb 23 14:10:00 CET 2011


Author: dietmar
Date: 2011-02-23 14:10:00 +0100 (Wed, 23 Feb 2011)
New Revision: 5607

Modified:
   pve-manager/pve2/www/manager/ClusterConfig.js
Log:
implement ACL view


Modified: pve-manager/pve2/www/manager/ClusterConfig.js
===================================================================
--- pve-manager/pve2/www/manager/ClusterConfig.js	2011-02-23 13:09:24 UTC (rev 5606)
+++ pve-manager/pve2/www/manager/ClusterConfig.js	2011-02-23 13:10:00 UTC (rev 5607)
@@ -142,7 +142,6 @@
 });
 Ext.reg('pveGroupView', PVE.GroupView);
 
-
 PVE.RoleView = Ext.extend(PVE.grid.StdGrid, {
 
     initComponent : function() {
@@ -200,6 +199,70 @@
 });
 Ext.reg('pveRoleView', PVE.RoleView);
 
+PVE.ACLView = Ext.extend(PVE.grid.StdGrid, {
+
+    initComponent : function() {
+	var self = this;
+
+	var store = new Ext.data.JsonStore({
+	    url: "/api2/json/access/acl",
+	    autoDestory: true,
+	    root: 'data',
+	    restful: true, // use GET, not POST
+	    fields: [ 'path', 'type', 'ugid', 'roleid', 
+		      { name: 'propagate', type: 'boolean'} ],
+	    sortInfo: { field: 'path', order: 'DESC' }
+	});
+
+	var render_ugid = function(ugid, metaData, record) {
+	    if (record.data.type == 'group')
+		return '@' + ugid;
+
+	    return ugid;
+	};
+
+	Ext.apply(self, {
+	    store: store,
+	    stateful: false,
+	    columns: [
+		{
+		    header: 'Path',
+		    width: 200,
+		    sortable: true,
+		    dataIndex: 'path'
+		},
+		{
+		    header: 'User/Group',
+		    width: 200,
+		    sortable: true,
+		    renderer: render_ugid,
+		    dataIndex: 'ugid'
+		},
+		{
+		    header: 'Role',
+		    width: 150,
+		    sortable: true,
+		    dataIndex: 'roleid'
+		},
+		{
+		    header: 'Propagate',
+		    width: 80,
+		    sortable: true,
+		    dataIndex: 'propagate'
+		}
+	    ],
+	    listeners: {
+		show: function() {
+		    store.load();
+		}
+	    }
+	});
+
+	PVE.ACLView.superclass.initComponent.call(self);
+    }
+});
+Ext.reg('pveACLView', PVE.ACLView);
+
 PVE.AuthView = Ext.extend(PVE.grid.StdGrid, {
 
     initComponent : function() {
@@ -288,9 +351,9 @@
 		    id: 'groups'
 		},
 		{
+		    xtype: 'pveACLView',
 		    title: 'Permissions',
 		    id: 'permissions',
-		    html: 'permissions ' + clusterid
 		},
 		{
 		    xtype: 'pveRoleView',



More information about the pve-devel mailing list