app/soc/views/models/club_member.py
changeset 1163 d8c50be19232
parent 1116 5a9d4c2d6748
child 1184 bd9c6101d41d
equal deleted inserted replaced
1162:1d9396d75c13 1163:d8c50be19232
    24 
    24 
    25 from django import forms
    25 from django import forms
    26 
    26 
    27 from soc.logic import dicts
    27 from soc.logic import dicts
    28 from soc.logic.models import club as club_logic
    28 from soc.logic.models import club as club_logic
       
    29 from soc.logic.models import club_admin as club_admin_logic
    29 from soc.views.helper import access
    30 from soc.views.helper import access
    30 from soc.views.helper import dynaform
    31 from soc.views.helper import dynaform
    31 from soc.views.helper import widgets
    32 from soc.views.helper import widgets
    32 from soc.views.models import club as club_view
    33 from soc.views.models import club as club_view
    33 from soc.views.models import role
    34 from soc.views.models import role
    48       params: a dict with params for this View
    49       params: a dict with params for this View
    49     """
    50     """
    50 
    51 
    51     rights = access.Checker(params)
    52     rights = access.Checker(params)
    52     rights['create'] = ['checkIsDeveloper']
    53     rights['create'] = ['checkIsDeveloper']
    53     rights['edit'] = [('checkIsMyActiveRole',soc.logic.models.club_member)]
    54     rights['edit'] = [('checkHasRole', club_admin_logic.logic)]
    54     rights['delete'] = ['checkIsDeveloper']
    55     rights['delete'] = ['checkIsDeveloper']
    55     rights['invite'] = ['checkIsClubAdminForClub']
    56     rights['invite'] = [('checkHasRole', club_admin_logic.logic)]
    56     rights['accept_invite'] = [('checkCanCreateFromRequest','club_member')]
    57     rights['accept_invite'] = [('checkCanCreateFromRequest','club_member')]
    57     rights['request'] = ['checkIsUser',
    58     rights['request'] = ['checkIsUser',
    58         ('checkCanMakeRequestToGroup', club_logic)]
    59                          ('checkCanMakeRequestToGroup', club_logic)]
    59     rights['process_request'] = ['checkIsClubAdminForClub',
    60     rights['process_request'] = [('checkHasRole', club_admin_logic.logic),
    60         ('checkCanProcessRequest','club_member')]
    61                                  ('checkCanProcessRequest','club_member')]
    61     rights['manage'] = [
    62     rights['manage'] = [('checkIsAllowedToManageRole',
    62         ('checkIsAllowedToManageRole', [soc.logic.models.club_member,
    63                          [soc.logic.models.club_member,
    63              soc.logic.models.club_admin])]
    64                           soc.logic.models.club_admin])]
    64 
    65 
    65     new_params = {}
    66     new_params = {}
    66     new_params['logic'] = soc.logic.models.club_member.logic
    67     new_params['logic'] = soc.logic.models.club_member.logic
    67     new_params['group_logic'] = club_logic.logic
    68     new_params['group_logic'] = club_logic.logic
    68     new_params['group_view'] = club_view.view
    69     new_params['group_view'] = club_view.view