Skip to content

Commit 4139420

Browse files
committed
Fix issue2550553.
1 parent d69f0fe commit 4139420

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

roundup/cgi/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ def handle(self):
820820

821821
class RegisterAction(RegoCommon, EditCommon):
822822
name = 'register'
823-
permissionType = 'Create'
823+
permissionType = 'Register'
824824

825825
def handle(self):
826826
"""Attempt to create a new user based on the contents of the form

roundup/cgi/templating.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,9 @@ def is_edit_ok(self):
12681268
return self._db.security.hasPermission('Edit', self._client.userid,
12691269
self._classname, self._name, self._nodeid)
12701270
return self._db.security.hasPermission('Create', self._client.userid,
1271-
self._classname, self._name)
1271+
self._classname, self._name) or \
1272+
self._db.security.hasPermission('Register', self._client.userid,
1273+
self._classname, self._name)
12721274

12731275
def is_view_ok(self):
12741276
""" Is the user allowed to View the current class?

share/roundup/templates/classic/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
136136
<input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}">
137137
<span tal:replace="structure request/indexargs_form" />
138138
<a href="user?@template=register"
139-
tal:condition="python:request.user.hasPermission('Create', 'user')"
139+
tal:condition="python:request.user.hasPermission('Register', 'user')"
140140
i18n:translate="">Register</a><br>
141141
<a href="user?@template=forgotten" i18n:translate="">Lost&nbsp;your&nbsp;login?</a><br>
142142
</p>

share/roundup/templates/classic/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
roles=String(), # comma-separated string of Role names
4848
timezone=String())
4949
user.setkey("username")
50+
db.security.addPermission(name='Register', klass='user',
51+
description='User is allowed to register new user')
5052

5153
# FileClass automatically gets this property in addition to the Class ones:
5254
# content = String() [saved to disk in <tracker home>/db/files/]
@@ -154,7 +156,7 @@ def edit_query(db, userid, itemid):
154156
# Assign the appropriate permissions to the anonymous user's Anonymous
155157
# Role. Choices here are:
156158
# - Allow anonymous users to register
157-
db.security.addPermissionToRole('Anonymous', 'Create', 'user')
159+
db.security.addPermissionToRole('Anonymous', 'Register', 'user')
158160

159161
# Allow anonymous users access to view issues (and the related, linked
160162
# information)

share/roundup/templates/minimal/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
135135
<input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}">
136136
<span tal:replace="structure request/indexargs_form" />
137137
<a href="user?@template=register"
138-
tal:condition="python:request.user.hasPermission('Create', 'user')"
138+
tal:condition="python:request.user.hasPermission('Register', 'user')"
139139
i18n:translate="">Register</a><br>
140140
<a href="user?@template=forgotten" i18n:translate="">Lost&nbsp;your&nbsp;login?</a><br>
141141
</p>

share/roundup/templates/minimal/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ def own_record(db, userid, itemid):
6060
# Assign the appropriate permissions to the anonymous user's
6161
# Anonymous Role. Choices here are:
6262
# - Allow anonymous users to register
63-
db.security.addPermissionToRole('Anonymous', 'Create', 'user')
63+
db.security.addPermissionToRole('Anonymous', 'Register', 'user')
6464

6565
# vim: set et sts=4 sw=4 :

0 commit comments

Comments
 (0)