Changeset 3107c52 for asadb/groups


Ignore:
Timestamp:
Aug 21, 2011, 7:18:44 PM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
1de230f
Parents:
0653daa
git-author:
Alex Dehnert <adehnert@…> (08/21/11 19:18:44)
git-committer:
Alex Dehnert <adehnert@…> (08/21/11 19:18:44)
Message:

Add non-publicly-viewable OfficerRoles?

Location:
asadb/groups
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/admin.py

    r5eb3da3 r3107c52  
    6060        'max_count',
    6161        'require_student',
     62        'publicly_visible',
    6263        'grant_user',
    6364    )
  • asadb/groups/models.py

    rb6a0b03 r3107c52  
    129129    require_student = models.BooleanField(default=False)
    130130    grant_user = models.ForeignKey(User, null=True, blank=True, )
     131    publicly_visible = models.BooleanField(default=True, help_text='Can everyone see the holders of this office.')
    131132
    132133    def max_count_str(self, ):
  • asadb/groups/views.py

    r243437e r3107c52  
    187187        # People involved in the group
    188188        just_roles = groups.models.OfficerRole.objects.all()
     189        if context['viewpriv'] or self.request.user.has_perm('groups.view_signatories'):
     190            # Can see the non-public stuff
     191            pass
     192        else:
     193            just_roles = just_roles.filter(publicly_visible=True)
    189194        roles = []
    190195        for role in just_roles:
Note: See TracChangeset for help on using the changeset viewer.