LP#
1480432: choose broadest depth if staff has same perm multiple times
Fixes a staff user permission depth issue that can exist when multiple
permission groups are assigned. In particular, this patch clarifies
that if a given permission is assigned to a staff member multiple times,
e.g., via mutiple profiles or by individual permission mapping, whatever
permission depth is the broadest will apply.
To test
-------
[1] Run the t/lp1480432_test_func.permissions.usr_perms_depth_sort.pg
pgTAP test.
[2] Set up a staff user that has the same permission at multiple
depths, and verify that its scope of applicability applies
at the broadest depth. For example, if you give SET_CIRC_CLAIMS_RETURNED
at system and consortial depth, verify that the staff user can
mark any loan as claims returned regardless of system.
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>