Skip to content

Commit

Permalink
- Prevent creation of users/groups/roles with empty ID in the ZODB (f…
Browse files Browse the repository at this point in the history
…ixes #70)
  • Loading branch information
dataflake committed Aug 20, 2020
1 parent 26c893a commit e2b89f1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Change Log
2.5 (unreleased)
----------------

- Prevent creation of users/groups/roles with empty ID in the ZODB
(`#70
<https://github.com/zopefoundation/Products.PluggableAuthService/issues/70>`_)

- update configuration for version 5 of ``isort``


Expand Down
8 changes: 5 additions & 3 deletions Products/PluggableAuthService/plugins/ZODBGroupManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,11 @@ def manage_addGroup(self, group_id, title=None, description=None,
RESPONSE=None):
""" Add a group via the ZMI.
"""
self.addGroup(group_id, title, description)

message = 'Group+added'
if not group_id:
message = 'Please+provide+a+Group+ID'
else:
self.addGroup(group_id, title, description)
message = 'Group+added'

if RESPONSE is not None:
RESPONSE.redirect('%s/manage_groups?manage_tabs_message=%s' %
Expand Down
8 changes: 5 additions & 3 deletions Products/PluggableAuthService/plugins/ZODBRoleManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,11 @@ def manage_addRole(self, role_id, title, description, RESPONSE=None,
REQUEST=None):
""" Add a role via the ZMI.
"""
self.addRole(role_id, title, description)

message = 'Role+added'
if not role_id:
message = 'Please+provide+a+Role+ID'
else:
self.addRole(role_id, title, description)
message = 'Role+added'

if RESPONSE is not None:
RESPONSE.redirect('%s/manage_roles?manage_tabs_message=%s' %
Expand Down
3 changes: 3 additions & 0 deletions Products/PluggableAuthService/plugins/ZODBUserManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ def manage_addUser(self, user_id, login_name, password, confirm,
if password != confirm:
message = 'password+and+confirm+do+not+match'

elif not user_id:
message = 'Please+provide+a+User+ID'

else:

if not login_name:
Expand Down

0 comments on commit e2b89f1

Please sign in to comment.