Menu

#22 wrong privileges on collection with multiple groups

open-fixed
None
5
2012-04-05
2012-04-04
No

When a user has different privileges on a collection due to membership in several groups, the sql function path_privs might not get the correct resulting privileges. This happens because the query
SELECT privileges INTO out_conferred FROM grants
WHERE by_collection = grantor_collection
AND (to_principal=in_accessor OR to_principal IN (SELECT expand_memberships(in_accessor,in_depth)));

can deliver more than one row in this case, and it's quite arbitrary whether the highest privilege is first or not. The correct solution is probably to or-aggregate all bits to obtain all privileges over all groups the user is member in:

SELECT bit_or(privileges) INTO out_conferred FROM grants
WHERE by_collection = grantor_collection
AND (to_principal=in_accessor OR to_principal IN (SELECT expand_memberships(in_accessor,in_depth)));

This applies to V1.02

Discussion

  • Andrew McMillan

    Andrew McMillan - 2012-04-05

    Thanks. This is fixed in Git now and will be in the next release.

     
  • Andrew McMillan

    Andrew McMillan - 2012-04-05
    • assigned_to: nobody --> karora
    • status: open --> open-fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.