Skip to content

Commit

Permalink
ACLs - User Group Permissions fixes
Browse files Browse the repository at this point in the history
Fixes to address PR review issues
  • Loading branch information
smg6511 committed Sep 13, 2023
1 parent c1c0d23 commit d6b3bda
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODx.grid.UserGroupCategory = function(config = {}) {
action: 'Security/Access/UserGroup/Category/GetList'
,usergroup: config.usergroup
,category: MODx.request.category || null
,policy: MODx.request.policy || null
,policy: this.applyRequestFilter(2)
}
,fields: [
'id',
Expand Down Expand Up @@ -109,7 +109,7 @@ MODx.grid.UserGroupCategory = function(config = {}) {
,emptyText: _('filter_by_policy')
,width: 180
,allowBlank: true
,value: MODx.request.policy || null
,value: this.applyRequestFilter(2)
,baseParams: {
action: 'Security/Access/Policy/GetList',
group: 'Element,Object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODx.grid.UserGroupContext = function(config) {
action: 'Security/Access/UserGroup/Context/GetList'
,usergroup: config.usergroup
,context: MODx.request.context || null
,policy: MODx.request.policy || null
,policy: this.applyRequestFilter(0)
}
,fields: [
'id',
Expand Down Expand Up @@ -46,7 +46,6 @@ MODx.grid.UserGroupContext = function(config) {
{
header: _('context')
,dataIndex: 'target'
,width: 120
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('context/update', 'target', {
Expand All @@ -55,13 +54,11 @@ MODx.grid.UserGroupContext = function(config) {
},{
header: _('minimum_role')
,dataIndex: 'authority_name'
,width: 100
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/permission', 'authority_name')
},{
header: _('policy')
,dataIndex: 'policy_name'
,width: 200
,sortable: true
,xtype: 'templatecolumn'
,tpl: this.getLinkTemplate('security/access/policy/update', 'policy_name', {
Expand Down Expand Up @@ -105,7 +102,7 @@ MODx.grid.UserGroupContext = function(config) {
,emptyText: _('filter_by_policy')
,width: 180
,allowBlank: true
,value: MODx.request.policy || null
,value: this.applyRequestFilter(0)
,baseParams: {
action: 'Security/Access/Policy/GetList',
group: 'Administrator,Context,Object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ MODx.grid.UserGroupNamespace = function(config) {
,baseParams: {
action: 'Security/Access/UserGroup/AccessNamespace/GetList'
,usergroup: config.usergroup
,namespace: MODx.request.ns || null
,policy: MODx.request.policy || null
,namespace: this.applyRequestFilter(4, 'ns')
,policy: this.applyRequestFilter(4)
}
,fields: [
'id',
'target',
'name',
'principal',
'authority',
'authority_name',
'target',
'name',
'principal',
'authority',
'authority_name',
'policy',
'policy_name',
'context_key',
'permissions',
'cls'
'permissions',
'cls'
]
,paging: true
,hideMode: 'offsets'
Expand Down Expand Up @@ -83,7 +83,7 @@ MODx.grid.UserGroupNamespace = function(config) {
,editable: false
,width: 200
,allowBlank: true
,value: MODx.request.ns || null
,value: this.applyRequestFilter(4, 'ns')
,baseParams: {
action: 'Workspace/PackageNamespace/GetList',
isGridFilter: true,
Expand All @@ -96,8 +96,8 @@ MODx.grid.UserGroupNamespace = function(config) {
this.updateDependentFilter('filter-policy-namespace', 'namespace', record.data.name);
/*
There's an odd conflict in the processor when using 'namespace' as the
query param, therefor the alternate param 'ns' is used this listener, its component value, and in the value of
this grid's main baseParams config
query param, therefor the alternate param 'ns' is used for this listener, its component value,
and in the value of this grid's main baseParams config
*/
this.applyGridFilter(cmp, 'ns');
},
Expand All @@ -110,7 +110,7 @@ MODx.grid.UserGroupNamespace = function(config) {
,emptyText: _('filter_by_policy')
,width: 180
,allowBlank: true
,value: MODx.request.policy || null
,value: this.applyRequestFilter(4)
,baseParams: {
action: 'Security/Access/Policy/GetList',
group: 'Namespace',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODx.grid.UserGroupResourceGroup = function(config) {
action: 'Security/Access/UserGroup/ResourceGroup/GetList'
,usergroup: config.usergroup
,resourceGroup: MODx.request.resourceGroup || null
,policy: MODx.request.policy || null
,policy: this.applyRequestFilter(1)
}
,fields: [
'id',
Expand Down Expand Up @@ -112,7 +112,7 @@ MODx.grid.UserGroupResourceGroup = function(config) {
,emptyText: _('filter_by_policy')
,width: 180
,allowBlank: true
,value: MODx.request.policy || null
,value: this.applyRequestFilter(1)
,baseParams: {
action: 'Security/Access/Policy/GetList',
group: 'Resource,Object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODx.grid.UserGroupSource = function(config) {
action: 'Security/Access/UserGroup/Source/GetList'
,usergroup: config.usergroup
,source: MODx.request.source || null
,policy: MODx.request.policy || null
,policy: this.applyRequestFilter(3)
}
,fields: [
'id',
Expand Down Expand Up @@ -105,7 +105,7 @@ MODx.grid.UserGroupSource = function(config) {
,emptyText: _('filter_by_policy')
,width: 180
,allowBlank: true
,value: MODx.request.policy || null
,value: this.applyRequestFilter(3)
,baseParams: {
action: 'Security/Access/Policy/GetList',
group: 'MediaSource',
Expand Down

0 comments on commit d6b3bda

Please sign in to comment.