Clarified docstring in access.py and changed edit access checks for role views.
Addresses Issue 455.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/helper/access.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/helper/access.py Fri Mar 27 11:16:35 2009 +0000
@@ -1370,7 +1370,7 @@
django_args: a dictionary with django's arguments
logic: the logic that should be used to fetch the entity
field_name: the name of the field the entity uses to store it's owner
- user: whether the entity stores the user's key name, or a reference
+ user: true iff the entity stores the user's reference, false iff keyname
"""
self.checkIsUser(django_args)
--- a/app/soc/views/models/club_admin.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/club_admin.py Fri Mar 27 11:16:35 2009 +0000
@@ -53,7 +53,7 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
rights['edit'] = [('checkHasActiveRoleForScope', club_admin_logic.logic),
- ('checkIsMyEntity', club_admin.logic)]
+ ('checkIsMyEntity', [club_admin_logic.logic, 'user', True])]
rights['delete'] = ['checkIsDeveloper']
rights['invite'] = [('checkHasActiveRoleForScope', club_admin_logic.logic)]
rights['accept_invite'] = [('checkCanCreateFromRequest', 'club_admin')]
--- a/app/soc/views/models/club_member.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/club_member.py Fri Mar 27 11:16:35 2009 +0000
@@ -54,7 +54,7 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
rights['edit'] = [('checkHasActiveRoleForScope', club_member_logic.logic),
- ('checkIsMyEntity', club_member_logic.logic)]
+ ('checkIsMyEntity', [club_member_logic.logic, 'user', True])]
rights['delete'] = ['checkIsDeveloper']
rights['invite'] = [('checkHasActiveRoleForScope', club_admin_logic.logic)]
rights['accept_invite'] = [('checkCanCreateFromRequest','club_member')]
--- a/app/soc/views/models/host.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/host.py Fri Mar 27 11:16:35 2009 +0000
@@ -57,7 +57,7 @@
rights = access.Checker(params)
rights['create'] = [('checkHasActiveRoleForScope', host_logic.logic)]
rights['edit'] = [('checkHasActiveRoleForScope', host_logic.logic),
- ('checkIsMyEntity', host_logic.logic)]
+ ('checkIsMyEntity', [host_logic.logic, 'user', True])]
rights['invite'] = [('checkHasActiveRoleForScope', host_logic.logic)]
rights['list'] = ['checkIsDeveloper']
rights['accept_invite'] = [('checkCanCreateFromRequest','host')]
--- a/app/soc/views/models/mentor.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/mentor.py Fri Mar 27 11:16:35 2009 +0000
@@ -57,7 +57,7 @@
rights['create'] = ['checkIsDeveloper']
rights['edit'] = [('checkHasActiveRoleForScope',
soc.logic.models.mentor.logic),
- ('checkIsMyEntity', soc.logic.models.mentor.logic)]
+ ('checkIsMyEntity', [soc.logic.models.mentor.logic, 'user', True])]
rights['delete'] = ['checkIsDeveloper']
rights['invite'] = [('checkHasActiveRoleForScope',
soc.logic.models.org_admin.logic)]
--- a/app/soc/views/models/org_admin.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/org_admin.py Fri Mar 27 11:16:35 2009 +0000
@@ -61,7 +61,7 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
rights['edit'] = [('checkHasActiveRoleForScope', org_admin_logic.logic),
- ('checkIsMyEntity', org_admin_logic.logic)]
+ ('checkIsMyEntity', [org_admin_logic.logic, 'user', True])]
rights['delete'] = ['checkIsDeveloper']
rights['invite'] = [('checkHasActiveRoleForScope',
org_admin_logic.logic)]
--- a/app/soc/views/models/student.py Fri Mar 27 10:34:18 2009 +0000
+++ b/app/soc/views/models/student.py Fri Mar 27 11:16:35 2009 +0000
@@ -57,7 +57,7 @@
rights = access.Checker(params)
rights['create'] = ['checkIsDeveloper']
rights['edit'] = [('checkHasActiveRoleForScope', student_logic.logic),
- ('checkIsMyEntity', student_logic.logic)]
+ ('checkIsMyEntity', [student_logic.logic, 'user', True])]
rights['delete'] = ['checkIsDeveloper']
rights['apply'] = [
'checkIsUser',