Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-2723

Nested COUs lead to wrong UI permission calculation for CO Person Role

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
            scott.koranda@at.internet2.edu Scott Koranda (uwm.edu/illinois.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: