Skip to content

Commit

Permalink
Add authorized users group configuration.Improved/Simplified existing…
Browse files Browse the repository at this point in the history
… code.
  • Loading branch information
Ioannis committed Feb 20, 2024
1 parent 69c66ad commit d4c2cf8
Show file tree
Hide file tree
Showing 14 changed files with 705 additions and 565 deletions.
1 change: 1 addition & 0 deletions Config/Schema/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<field name="identifier_type" type="C" size="32" />
<field name="conn_ver" type="C" size="256" />
<field name="grouper_url" type="C" size="256" />
<field name="act_as_grp_name" type="C" size="512" />
<field name="conn_user" type="C" size="64" />
<field name="conn_pass" type="C" size="64" />
<field name="adhoc_heading" type="C" size="64" />
Expand Down
10 changes: 5 additions & 5 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,21 +590,21 @@ public function leaveGroup()
function isAuthorized()
{
$roles = $this->Role->calculateCMRoles();

$cfg = $this->CoGrouperLiteWidget->getConfig();
// Find the identifier
$args = array();
// XXX This should become configuration
$args['conditions']['Identifier.type'] = 'I2CollabPN';
$args['conditions']['Identifier.type'] = $cfg['CoGrouperLiteWidget']['identifier_type'];
$args['conditions']['Identifier.status'] = SuspendableStatusEnum::Active;
$args['conditions']['Identifier.co_person_id'] = $roles["copersonid"];
$args['conditions']['Identifier.co_person_id'] = $roles['copersonid'];
$args['contain'] = false;

$identifiers = $this->Identifier->find('first', $args);
if(!empty($identifiers)
&& is_array($identifiers)
&& isset($identifiers["Identifier"]["identifier"])
&& isset($identifiers['Identifier']['identifier'])
) {
$this->userId = $identifiers["Identifier"]["identifier"];
$this->userId = $identifiers['Identifier']['identifier'];
}

// Determine what operations this user can perform
Expand Down
Loading

0 comments on commit d4c2cf8

Please sign in to comment.