--- a/app/soc/views/helper/access.py Sat Feb 28 12:11:20 2009 +0000
+++ b/app/soc/views/helper/access.py Sat Feb 28 12:32:52 2009 +0000
@@ -726,8 +726,20 @@
Only roles where the link_id matches the link_id from the
django_args are considered.
"""
+
self._checkHasActiveRoleFor(django_args, logic, 'link_id')
+ def checkHasActiveRoleForLinkIdAsScope(self, django_args, logic):
+ """Checks that the user has the specified active role.
+
+ Only roles where the link_id matches the link_id from the
+ django_args are considered.
+ """
+
+ django_args = django_args.copy()
+ django_args['scope_path'] = django_args['link_id']
+ self._checkHasActiveRoleFor(django_args, logic, 'scope_path')
+
def checkHasDocumentAccess(self, django_args, logic, target_scope):
"""Checks that the user has access to the specified document scope.
"""
--- a/app/soc/views/models/sponsor.py Sat Feb 28 12:11:20 2009 +0000
+++ b/app/soc/views/models/sponsor.py Sat Feb 28 12:32:52 2009 +0000
@@ -50,13 +50,13 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
- rights['edit'] = [('checkHasActiveRoleForLinkId', host_logic),
+ rights['edit'] = [('checkHasActiveRoleForLinkIdAsScope', host_logic),
('checkGroupIsActiveForLinkId', sponsor_logic)]
rights['delete'] = ['checkIsDeveloper']
rights['home'] = [('checkHasActiveRoleForScope', host_logic)]
rights['list'] = ['checkIsDeveloper']
- rights['list_requests'] = [('checkHasActiveRoleForScope', host_logic)]
- rights['list_roles'] = [('checkHasActiveRoleForScope', host_logic)]
+ rights['list_requests'] = [('checkHasActiveRoleForLinkIdAsScope', host_logic)]
+ rights['list_roles'] = [('checkHasActiveRoleForLinkIdAsScope', host_logic)]
new_params = {}
new_params['logic'] = soc.logic.models.sponsor.logic