Redone access checks in club and sponsor model to deal with state property in their model.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/models/club.py Thu Jan 29 15:54:50 2009 +0000
+++ b/app/soc/views/models/club.py Thu Jan 29 15:55:40 2009 +0000
@@ -60,11 +60,11 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
- rights['edit'] = ['checkIsClubAdminForClub']
+ rights['edit'] = ['checkIsClubAdminForClub', ('checkIsGroupActive', club_logic)]
rights['delete'] = ['checkIsDeveloper']
rights['home'] = ['allow']
rights['list'] = ['checkIsDeveloper']
- rights['apply_member'] = ['checkIsUser']
+ rights['apply_member'] = ['checkIsUser', ('checkIsGroupActive', club_logic)]
rights['list_requests'] = ['checkIsClubAdminForClub']
rights['list_roles'] = ['checkIsClubAdminForClub']
rights['applicant'] = [('checkIsApplicationAccepted', club_app_logic)]
@@ -90,7 +90,6 @@
new_params['sidebar_additional'] = [
('/' + new_params['url_name'] + '/apply_member', 'Join a Club', 'apply_member'),]
- new_params['extra_dynaexclude'] = ['founder', 'home']
new_params['edit_extra_dynafields'] = {
'founded_by': forms.CharField(widget=widgets.ReadOnlyInput(),
required=False),
--- a/app/soc/views/models/sponsor.py Thu Jan 29 15:54:50 2009 +0000
+++ b/app/soc/views/models/sponsor.py Thu Jan 29 15:55:40 2009 +0000
@@ -47,7 +47,8 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
- rights['edit'] = ['checkIsHostForSponsor']
+ rights['edit'] = ['checkIsHostForSponsor',
+ ('checkIsGroupActive', soc.logic.models.sponsor)]
rights['delete'] = ['checkIsDeveloper']
rights['home'] = ['checkIsHostForSponsor']
rights['list'] = ['checkIsDeveloper']