app/soc/views/models/club_app.py
changeset 876 0c1329d4b514
parent 875 03c674f510d8
child 882 267e31f1a0b6
--- a/app/soc/views/models/club_app.py	Wed Jan 21 16:12:31 2009 +0000
+++ b/app/soc/views/models/club_app.py	Wed Jan 21 16:12:48 2009 +0000
@@ -35,6 +35,7 @@
 from soc.views import helper
 from soc.views import out_of_band
 from soc.views.helper import access
+from soc.views.helper import decorators
 from soc.views.helper import redirects
 from soc.views.helper import lists as list_helper
 from soc.views.models import group_app
@@ -102,6 +103,8 @@
 
     super(View, self).__init__(params=params)
 
+  @decorators.merge_params
+  @decorators.check_access
   def list(self, request, access_type,
            page_name=None, params=None, filter=None):
     """Lists all notifications that the current logged in user has stored.
@@ -109,13 +112,6 @@
     for parameters see base.list()
     """
 
-    params = dicts.merge(params, self._params)
-
-    try:
-      access.checkAccess(access_type, request, params['rights'])
-    except out_of_band.Error, error:
-      return helper.responses.errorResponse(error, request)
-
     # get the current user
     user_entity = user_logic.logic.getForCurrentAccount()
 
@@ -214,6 +210,8 @@
 
     context['entity_type_url'] = self._params['url_name']
 
+  @decorators.merge_params
+  @decorators.check_access
   def review(self, request, access_type,
              page_name=None, params=None, **kwargs):
     """Handles the view containing the review of an application.
@@ -225,13 +223,6 @@
     For params see base.View.public().
     """
 
-    params = dicts.merge(params, self._params)
-
-    try:
-      access.checkAccess(access_type, request, rights=params['rights'])
-    except out_of_band.Error, error:
-      return helper.responses.errorResponse(error, request)
-
     # create default template context for use with any templates
     context = helper.responses.getUniversalContext(request)
     context['page_name'] = page_name
@@ -278,6 +269,8 @@
     return super(View, self).public(request, access_type,
         page_name=page_name, params=params, **kwargs)
 
+  @decorators.merge_params
+  @decorators.check_access
   def reviewOverview(self, request, access_type,
              page_name=None, params=None, **kwargs):
     """Displays multiple lists of applications that are in different