Skip to content

Commit

Permalink
Resource Access updates
Browse files Browse the repository at this point in the history
Render links and checkboxes according to user permissions
  • Loading branch information
smg6511 committed Dec 10, 2024
1 parent 22b2232 commit 54b2a89
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ MODx.grid.ResourceSecurity = function(config = {}) {
sortable: true,
renderer: {
fn: function(value, metaData, record) {
return this.renderLink(value, {
href: '?a=security/resourcegroup',
target: '_blank'
});
const canEditResourceGroups = MODx.perm.resourcegroup_edit || MODx.perm.resourcegroup_resource_edit;
return canEditResourceGroups
? this.renderLink(value, {
href: `?a=security/resourcegroup&id=${record.data.id}`,
target: '_blank'
})
: value
;
},
scope: this
}
Expand Down

0 comments on commit 54b2a89

Please sign in to comment.