Skip to content

Commit

Permalink
Updated to include XACML in button display
Browse files Browse the repository at this point in the history
Made changes to ensure that XACML was respected as well as the
roles when graying out the buttons.
  • Loading branch information
jonathangreen committed Nov 14, 2011
1 parent a35597a commit 03d3b4d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ADRCollection.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ class ADRCollection {
'Content.js',
);

$canAddNewObject = user_access("Add Object");
$canAddNewCollection = user_access("Edit Subcollection");
global $user;
module_load_include('inc', 'islandora_xacml_editor', 'Xacml');
$xacml = Xacml::constructFromPid($this->pid);
$canManageInXacml = $xacml->managementRule->hasPermission($user->name, $user->roles);

$canAddNewObject = user_access("Add Object") && $canManageInXacml;
$canAddNewCollection = user_access("Edit Subcollection") && $canManageInXacml;
$canEditObjects = user_access("Edit Object");
$canEditPermissions = user_access("Edit Permissions");
$canEditChildPermissions = user_access("Edit Child Permissions");
Expand Down

0 comments on commit 03d3b4d

Please sign in to comment.