app/soc/views/models/club.py
changeset 1163 d8c50be19232
parent 1153 4804f7f5a7c0
child 1184 bd9c6101d41d
equal deleted inserted replaced
1162:1d9396d75c13 1163:d8c50be19232
    27 
    27 
    28 from soc.logic import cleaning
    28 from soc.logic import cleaning
    29 from soc.logic import dicts
    29 from soc.logic import dicts
    30 from soc.logic.models import user as user_logic
    30 from soc.logic.models import user as user_logic
    31 from soc.logic.models import club_app as club_app_logic
    31 from soc.logic.models import club_app as club_app_logic
    32 from soc.logic.models import club as club_logic
    32 from soc.logic.models import club  as club_logic
       
    33 from soc.logic.models import club_admin as club_admin_logic
    33 from soc.logic.models import request as request_logic
    34 from soc.logic.models import request as request_logic
    34 from soc.views import out_of_band
    35 from soc.views import out_of_band
    35 from soc.views.helper import access
    36 from soc.views.helper import access
    36 from soc.views.helper import decorators
    37 from soc.views.helper import decorators
    37 from soc.views.helper import dynaform
    38 from soc.views.helper import dynaform
    55       params: a dict with params for this View
    56       params: a dict with params for this View
    56     """
    57     """
    57 
    58 
    58     rights = access.Checker(params)
    59     rights = access.Checker(params)
    59     rights['create'] = ['checkIsDeveloper']
    60     rights['create'] = ['checkIsDeveloper']
    60     rights['edit'] = ['checkIsClubAdminForClub', ('checkIsGroupActive', club_logic)]
    61     rights['edit'] = [('checkHasRole', club_admin_logic.logic),
       
    62                       ('checkIsActive', club_logic.logic)]
    61     rights['delete'] = ['checkIsDeveloper']
    63     rights['delete'] = ['checkIsDeveloper']
    62     rights['home'] = ['allow']
    64     rights['home'] = ['allow']
    63     rights['list'] = ['checkIsDeveloper']
    65     rights['list'] = ['checkIsDeveloper']
    64     rights['apply_member'] = ['checkIsUser', ('checkIsGroupActive', club_logic)]
    66     rights['apply_member'] = ['checkIsUser',
    65     rights['list_requests'] = ['checkIsClubAdminForClub']
    67                               ('checkIsActive', club_logic.logic)]
    66     rights['list_roles'] = ['checkIsClubAdminForClub']
    68     rights['list_requests'] = [('checkHasRole', club_admin_logic.logic)]
    67     rights['applicant'] = [('checkIsApplicationAccepted', club_app_logic)]
    69     rights['list_roles'] = [('checkHasRole', club_admin_logic.logic)]
       
    70     rights['applicant'] = [('checkIsApplicationAccepted',
       
    71                             club_app_logic.logic)]
    68 
    72 
    69     new_params = {}
    73     new_params = {}
    70     new_params['logic'] = soc.logic.models.club.logic
    74     new_params['logic'] = soc.logic.models.club.logic
    71     new_params['rights'] = rights
    75     new_params['rights'] = rights
    72     new_params['name'] = "Club"
    76     new_params['name'] = "Club"