--- a/app/soc/views/helper/access.py Wed Jan 28 02:24:13 2009 +0000
+++ b/app/soc/views/helper/access.py Wed Jan 28 02:25:51 2009 +0000
@@ -389,7 +389,7 @@
user_entity = user_logic.getForCurrentAccount()
if user_entity.link_id != django_args['link_id']:
- deny(django_args)
+ self.deny(django_args)
fields = {'link_id': django_args['link_id'],
'scope_path': django_args['scope_path'],
@@ -399,7 +399,7 @@
if request_entity.state != 'group_accepted':
# TODO tell the user that this request has not been accepted yet
- deny(django_args)
+ self.deny(django_args)
return
@@ -416,7 +416,7 @@
if request_entity.state in ['completed', 'denied']:
# TODO tell the user that this request has been processed
- deny(django_args)
+ self.deny(django_args)
return
@@ -431,7 +431,7 @@
if user_entity.link_id != django_args['link_id']:
# not the current user's request
- return deny(django_args)
+ self.deny(django_args)
fields = {'link_id': django_args['link_id'],
'scope_path': django_args['scope_path'],
@@ -441,10 +441,10 @@
if not request_entity:
# TODO return 404
- return deny(django_args)
+ self.deny(django_args)
if request_entity.state != 'group_accepted':
- return deny(django_args)
+ self.deny(django_args)
return
@@ -496,6 +496,7 @@
raise out_of_band.LoginRequest(message_fmt=login_message_fmt)
+ @allowDeveloper
def checkIsHostForSponsor(self, django_args):
"""Raises an alternate HTTP response if Google Account has no Host entity
for the specified Sponsor.
@@ -606,7 +607,7 @@
return
# TODO(srabbelier) Make this give a proper error message
- deny(django_args)
+ self.deny(django_args)
@allowDeveloper
def checkIsMyNotification(self, django_args):
@@ -637,7 +638,7 @@
return None
# TODO(ljvderijk) Make this give a proper error message
- deny(django_args)
+ self.deny(django_args)
@allowDeveloper
def checkIsMyApplication(self, django_args, app_logic):
@@ -661,18 +662,16 @@
application = app_logic.logic.getForFields(properties, unique=True)
if not application:
- deny(django_args)
-
- user = user_logic.getForCurrentAccount()
+ self.deny(django_args)
# We need to check to see if the key's are equal since the User
# objects are different and the default __eq__ method does not check
# if the keys are equal (which is what we want).
- if user.key() == application.applicant.key():
+ if self.user.key() == application.applicant.key():
return None
# TODO(srabbelier) Make this give a proper error message
- deny(django_args)
+ self.deny(django_args)
@allowDeveloper
def checkIsMyActiveRole(self, django_args, role_logic):
@@ -686,11 +685,9 @@
None if the current User has no active role for the given role_logic.
"""
- user = user_logic.getForCurrentAccount()
-
- if not user or user.link_id != django_args['link_id']:
+ if not self.user or self.user.link_id != django_args['link_id']:
# not my role
- deny(django_args)
+ self.deny(django_args)
fields = {'link_id': django_args['link_id'],
'scope_path': django_args['scope_path']
@@ -700,14 +697,14 @@
if not role_entity:
# no role found
- deny(django_args)
+ self.deny(django_args)
if role_entity.state == 'active':
# this role exist and is active
return
else:
# this role is not active
- deny(django_args)
+ self.deny(django_args)
def checkHasPickGetArgs(self, django_args):
"""Raises an alternate HTTP response if the request misses get args.
@@ -727,7 +724,7 @@
return
#TODO(SRabbelier) inform user that return_url and field are required
- deny(django_args)
+ self.deny(django_args)
def checkIsDocumentPublic(self, django_args):
"""Checks whether a document is public.
@@ -738,4 +735,4 @@
# TODO(srabbelier): A proper check needs to be done to see if the document
# is public or not, probably involving analysing it's scope or such.
- allow(django_args)
+ self.allow(django_args)
--- a/app/soc/views/helper/dynaform.py Wed Jan 28 02:24:13 2009 +0000
+++ b/app/soc/views/helper/dynaform.py Wed Jan 28 02:25:51 2009 +0000
@@ -121,14 +121,19 @@
if meta:
dynamodel = getattr(meta, 'model', None)
+ originclude = getattr(meta, 'include', [])
+ origexclude = getattr(meta, 'exclude', [])
+
if not dynainclude:
- dynainclude = []
+ dynainclude = originclude
+ originclude = []
if not dynaexclude:
- dynaexclude = []
+ dynaexclude = origexclude
+ origexclude = []
if append:
- dynainclude += getattr(meta, 'include', [])
- dynaexclude += getattr(meta, 'exclude', [])
+ dynainclude += originclude
+ dynaexclude += origexclude
# The most intersting parameter, the 'extra fields' dictionary
dynaconf = getattr(meta, 'dynaconf', {})
--- a/app/soc/views/models/club_admin.py Wed Jan 28 02:24:13 2009 +0000
+++ b/app/soc/views/models/club_admin.py Wed Jan 28 02:25:51 2009 +0000
@@ -54,7 +54,7 @@
rights['edit'] = [('checkIsMyActiveRole', soc.logic.models.club_admin)]
rights['delete'] = ['checkIsDeveloper']
rights['invite'] = ['checkIsClubAdminForClub']
- rights['accept_invite'] = ['checkCanCreateFromRequest', 'club_admin']
+ rights['accept_invite'] = [('checkCanCreateFromRequest', 'club_admin')]
rights['process_request'] = ['checkIsClubAdminForClub',
('checkCanProcessRequest', 'club_admin')]
--- a/app/soc/views/models/group.py Wed Jan 28 02:24:13 2009 +0000
+++ b/app/soc/views/models/group.py Wed Jan 28 02:25:51 2009 +0000
@@ -337,11 +337,13 @@
# get the documents for this group entity
doc_items = document_view.view.getMenusForScope(group_entity, params)
- doc_items = sidebar.getSidebarMenu(doc_items, params=doc_params)
+ doc_items = sidebar.getSidebarMenu(id, user, doc_items,
+ params=doc_params)
# get the group specific items
group_items = self._getExtraMenuItems(role_description, params)
- group_items = sidebar.getSidebarMenu(group_items, params=self._params)
+ group_items = sidebar.getSidebarMenu(id, user, group_items,
+ params=self._params)
# add the items together
menu['items'] = doc_items + group_items
--- a/app/soc/views/models/program.py Wed Jan 28 02:24:13 2009 +0000
+++ b/app/soc/views/models/program.py Wed Jan 28 02:25:51 2009 +0000
@@ -139,7 +139,7 @@
menu = {}
menu['heading'] = entity.short_name
items = document_view.view.getMenusForScope(entity, params)
- menu['items'] = sidebar.getSidebarMenu(items, params=doc_params)
+ menu['items'] = sidebar.getSidebarMenu(id, user, items, params=doc_params)
menus.append(menu)
return menus