Details
-
Bug
-
Resolution: Fixed
-
Major
-
COmanage Registry 4.3.1 (Ruddy Rex MR1)
-
None
Description
When registry/co_people/canvas/<ID> is rendered and the CO has nested COUs (COUs with parent/child relationships) then CO Person Roles that correspond to a child COU only have the "View" action rendered (behind the "gear") and not "Edit" or "Delete".
The reason is this piece of code:
// Action Column
|
if ($es // Editing self |
|| empty($r['Cou']) // No COU set for this person |
|| (isset($r['Cou']['name']) && in_array($r['Cou']['path'], $permissions['cous'])) |
)
|
in the View/CoPeople/fields.inc file.
Specifically the code
in_array($r['Cou']['path'], $permissions['cous']) |
can never be true because $r['Cou']['path'] has the structure for example
TSI Community / TSI-BPA Data Access-Members
|
but $permissions['cous'] has the structure for example
Array
|
(
|
[110] => BPA Data-Admins |
[109] => BPA Data-Editors |
[155] => BPA Service |
[111] => Manage BPA Roles |
[12] => Test |
[75] => TSI Community |
[99] => TSI-Approval New Registrations |
[92] => TSI-BPA Data Access-Members |
[100] => TSI-Manage TSI Roles |
[66] => TSI-Manager |
[123] => TSI-Sponsor New Members |
[74] => UniMelb Embargoed Dataset Access |
[72] => UniSyd Embargoed Dataset Access |
)
|
That is, $permissions['cous'] is an array of all COUs across all CO Person Roles for the CO Person, but $r['Cou']['path'] is a string made up of the "path" from the top parent to the child.