Changeset 2dd6045


Ignore:
Timestamp:
Aug 7, 2011, 4:43:17 AM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
a484cbf
Parents:
16b7515
git-author:
Alex Dehnert <adehnert@…> (08/07/11 04:43:17)
git-committer:
Alex Dehnert <adehnert@…> (08/07/11 04:43:17)
Message:

Create permissions for group administration

Location:
asadb/groups
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/models.py

    r16b7515 r2dd6045  
    5353    class Meta:
    5454        ordering = ('name', )
     55        permissions = (
     56            ('view_group_private_info', 'View private group information'),
     57            # ability to update normal group info or people
     58            # this is weaker than change_group, which is the built-in
     59            # permission that controls the admin interface
     60            ('admin_group', 'Administer basic group information'),
     61        )
    5562
    5663
  • asadb/groups/views.py

    r89be44c r2dd6045  
    4747    group = get_object_or_404(groups.models.Group, pk=group_id)
    4848
    49     if not request.user.has_perm('groups.change_group', group):
     49    if not request.user.has_perm('groups.admin_group', group):
    5050        raise PermissionDenied
    5151
     
    147147    group = get_object_or_404(groups.models.Group, pk=group_id)
    148148
    149     if not request.user.has_perm('groups.change_group', group):
     149    if not request.user.has_perm('groups.admin_group', group):
    150150        raise PermissionDenied
    151151
Note: See TracChangeset for help on using the changeset viewer.