Skip to content

Commit

Permalink
User group grids progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Graham authored and smg6511 committed Feb 18, 2024
1 parent f197da7 commit 6b90c0f
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,31 @@ MODx.grid.UserGroupCategory = function(config = {}) {
,usergroup: config.usergroup
,category: MODx.request.category || null
,policy: this.applyRequestFilter(2)
// ,policy: MODx.request.policy || null
,isGroupingGrid: true
}
,fields: [
'id',
'target',
'name',
'principal',
'authority',
'authority_name',
'role_display',
'policy',
'policy_name',
'context_key',
'permissions',
'cls'
]
,grouping: true
,groupBy: 'role_display'
,remoteGroup: true
,sortBy: 'name'
,remoteSort: true
,paging: true
,hideMode: 'offsets'
,grouping: true
,groupBy: 'authority_name'
,singleText: _('policy')
,pluralText: _('policies')
,sortBy: 'authority'
,sortDir: 'ASC'
,remoteSort: true
,plugins: [this.exp]
,columns: [
this.exp,
Expand All @@ -51,17 +53,19 @@ MODx.grid.UserGroupCategory = function(config = {}) {
,sortable: true
},{
header: _('minimum_role')
,dataIndex: 'authority_name'
,dataIndex: 'role_display'
,width: 100
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/permission', 'authority_name')
,tpl: this.getLinkTemplate('security/permission', 'role_display')
},{
header: _('policy')
,dataIndex: 'policy_name'
,width: 200
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/access/policy/update', 'policy_name', {
linkParams: [{ key: 'id', valueIndex: 'policy'}]
linkParams: [{ key: 'id', valueIndex: 'policy' }]
})
},{
header: _('context')
Expand All @@ -70,7 +74,7 @@ MODx.grid.UserGroupCategory = function(config = {}) {
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('context/update', 'context_key', {
linkParams: [{ key: 'key', valueIndex: 'context_key'}]
linkParams: [{ key: 'key', valueIndex: 'context_key' }]
})
}
]
Expand Down Expand Up @@ -135,6 +139,7 @@ MODx.grid.UserGroupCategory = function(config = {}) {
]
});
MODx.grid.UserGroupCategory.superclass.constructor.call(this,config);

this.addEvents('createAcl','updateAcl');

const gridFilterData = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* @param {Object} config An object of configuration properties
* @xtype modx-grid-user-group-contexts
*/
MODx.grid.UserGroupContext = function(config) {
config = config || {};
MODx.grid.UserGroupContext = function(config = {}) {
this.exp = new Ext.grid.RowExpander({
tpl: new Ext.Template('<p class="desc">{permissions}</p>'),
lazyRender: false,
Expand All @@ -19,27 +18,29 @@ MODx.grid.UserGroupContext = function(config) {
,usergroup: config.usergroup
,context: MODx.request.context || null
,policy: this.applyRequestFilter(0)
// ,policy: MODx.request.policy || null
,isGroupingGrid: true
}
,fields: [
'id',
'target',
'principal',
'authority',
'authority_name',
'role_display',
'policy',
'policy_name',
'permissions',
'cls'
]
,grouping: true
,groupBy: 'role_display'
,remoteGroup: true
,sortBy: 'target'
,remoteSort: true
,paging: true
,hideMode: 'offsets'
,grouping: true
,groupBy: 'authority_name'
,singleText: _('policy')
,pluralText: _('policies')
,sortBy: 'authority'
,sortDir: 'ASC'
,remoteSort: true
,plugins: [this.exp]
,columns: [
this.exp,
Expand All @@ -53,9 +54,11 @@ MODx.grid.UserGroupContext = function(config) {
})
},{
header: _('minimum_role')
,dataIndex: 'authority_name'
,dataIndex: 'role_display'
,width: 100
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/permission', 'authority_name')
,tpl: this.getLinkTemplate('security/permission', 'role_display')
},{
header: _('policy')
,dataIndex: 'policy_name'
Expand Down Expand Up @@ -127,6 +130,7 @@ MODx.grid.UserGroupContext = function(config) {
]
});
MODx.grid.UserGroupContext.superclass.constructor.call(this,config);

this.addEvents('createAcl','updateAcl');

const gridFilterData = [
Expand All @@ -149,7 +153,7 @@ MODx.grid.UserGroupContext = function(config) {
this.refreshFilterOptions(gridFilterData);
}
});
}
};
Ext.extend(MODx.grid.UserGroupContext,MODx.grid.Grid,{

combos: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* @param {Object} config An object of configuration properties
* @xtype modx-grid-user-group-namespace
*/
MODx.grid.UserGroupNamespace = function(config) {
config = config || {};
MODx.grid.UserGroupNamespace = function(config = {}) {
this.exp = new Ext.grid.RowExpander({
tpl: new Ext.Template('<p class="desc">{permissions}</p>'),
lazyRender: false,
Expand All @@ -19,29 +18,30 @@ MODx.grid.UserGroupNamespace = function(config) {
,usergroup: config.usergroup
,namespace: this.applyRequestFilter(4, 'ns')
,policy: this.applyRequestFilter(4)
,isGroupingGrid: true
}
,fields: [
'id',
'target',
'name',
'principal',
'authority',
'authority_name',
'role_display',
'policy',
'policy_name',
'context_key',
'permissions',
'cls'
]
,grouping: true
,groupBy: 'role_display'
,remoteGroup: true
,sortBy: 'name'
,remoteSort: true
,paging: true
,hideMode: 'offsets'
,grouping: true
,groupBy: 'authority_name'
,singleText: _('policy')
,pluralText: _('policies')
,sortBy: 'authority'
,sortDir: 'ASC'
,remoteSort: true
,plugins: [this.exp]
,columns: [
this.exp,
Expand All @@ -54,17 +54,19 @@ MODx.grid.UserGroupNamespace = function(config) {
,tpl: this.getLinkTemplate('workspaces/namespace', 'name')
},{
header: _('minimum_role')
,dataIndex: 'authority_name'
,dataIndex: 'role_display'
,width: 100
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/permission', 'authority_name')
,tpl: this.getLinkTemplate('security/permission', 'role_display')
},{
header: _('policy')
,dataIndex: 'policy_name'
,width: 200
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/access/policy/update', 'policy_name', {
linkParams: [{ key: 'id', valueIndex: 'policy'}]
linkParams: [{ key: 'id', valueIndex: 'policy' }]
})
}
]
Expand Down Expand Up @@ -135,6 +137,7 @@ MODx.grid.UserGroupNamespace = function(config) {
]
});
MODx.grid.UserGroupNamespace.superclass.constructor.call(this,config);

this.addEvents('createAcl','updateAcl');

const gridFilterData = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* @param {Object} config An object of configuration properties
* @xtype modx-grid-user-group-resource-groups
*/
MODx.grid.UserGroupResourceGroup = function(config) {
config = config || {};
MODx.grid.UserGroupResourceGroup = function(config = {}) {
this.exp = new Ext.grid.RowExpander({
tpl: new Ext.Template('<p class="desc">{permissions}</p>'),
lazyRender: false,
Expand All @@ -19,29 +18,31 @@ MODx.grid.UserGroupResourceGroup = function(config) {
,usergroup: config.usergroup
,resourceGroup: MODx.request.resourceGroup || null
,policy: this.applyRequestFilter(1)
// ,policy: MODx.request.policy || null
,isGroupingGrid: true
}
,fields: [
'id',
'target',
'name',
'principal',
'authority',
'authority_name',
'policy',
'policy_name',
'context_key',
'permissions',
'cls'
'target',
'name',
'principal',
'authority',
'role_display',
'policy',
'policy_name',
'context_key',
'permissions',
'cls'
]
,grouping: true
,groupBy: 'role_display'
,remoteGroup: true
,sortBy: 'name'
,remoteSort: true
,paging: true
,hideMode: 'offsets'
,grouping: true
,groupBy: 'authority_name'
,singleText: _('policy')
,pluralText: _('policies')
,sortBy: 'authority'
,sortDir: 'ASC'
,remoteSort: true
,plugins: [this.exp]
,columns: [
this.exp,
Expand All @@ -54,14 +55,16 @@ MODx.grid.UserGroupResourceGroup = function(config) {
,tpl: this.getLinkTemplate('security/resourcegroup', 'name')
},{
header: _('minimum_role')
,dataIndex: 'authority_name'
,dataIndex: 'role_display'
,width: 100
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/permission', 'authority_name')
,tpl: this.getLinkTemplate('security/permission', 'role_display')
},{
header: _('policy')
,dataIndex: 'policy_name'
,width: 200
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/access/policy/update', 'policy_name', {
linkParams: [{ key: 'id', valueIndex: 'policy'}]
Expand Down Expand Up @@ -137,6 +140,7 @@ MODx.grid.UserGroupResourceGroup = function(config) {
]
});
MODx.grid.UserGroupResourceGroup.superclass.constructor.call(this,config);

this.addEvents('createAcl','updateAcl');

const gridFilterData = [
Expand Down
Loading

0 comments on commit 6b90c0f

Please sign in to comment.