# HG changeset patch # User Sverre Rabbelier # Date 1235824372 0 # Node ID 9e32e6258319db59ecb7fdbe932521fc0b17bcb2 # Parent c81109a8a1a1ef224ccf4fc1be8dea30d54c3fcc Properly fixed host access now Patch by: Sverre Rabbelier diff -r c81109a8a1a1 -r 9e32e6258319 app/soc/views/helper/access.py --- 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. """ diff -r c81109a8a1a1 -r 9e32e6258319 app/soc/views/models/sponsor.py --- 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