Changeset 84af6d7


Ignore:
Timestamp:
Jan 27, 2012, 4:40:42 PM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
7654a6d
Parents:
7f2776e
git-author:
Alex Dehnert <adehnert@…> (01/27/12 16:40:42)
git-committer:
Alex Dehnert <adehnert@…> (01/27/12 16:40:42)
Message:

Fix PerGroupAuthz? to respect unqualified perms

If you have some permission with obj=None, then our desired semantics
(and what the admin seems to use) are that you have that permission
with any object. Unfortunately, that's not the semantics that the default
backend uses, so we need to implement it ourself. *sigh*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/models.py

    rfb1c047 r84af6d7  
    350350            return False
    351351        if isinstance(obj, Group):
     352            # Having the unqualified perm means that you should have it
     353            # on any object
     354            if user_obj.has_perm(perm):
     355                return True
    352356            # Now we can do the real work
    353357            holders = obj.officers(person=user_obj.username).select_related('role__grant_user')
Note: See TracChangeset for help on using the changeset viewer.