Redone access checks in club and sponsor model to deal with state property in their model.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 29 Jan 2009 15:55:40 +0000
changeset 1063 f529113e1bc5
parent 1062 f7ee38ebfe1c
child 1064 4f1d179f39ae
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
app/soc/views/models/club.py
app/soc/views/models/sponsor.py
--- 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']