zopefoundation / Products.PluggableAuthService

Pluggable Zope authentication / authorization framework
Other
9 stars 18 forks source link

TypeError adding role to user Zope 4.1.1 #54

Closed ewohnlich closed 4 years ago

ewohnlich commented 4 years ago

I am trying to add the Manager role to a new user on the root acl_users.

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 337, in publish_module
  Module ZPublisher.WSGIPublisher, line 255, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 61, in call_object
  Module Products.PluggableAuthService.utils, line 4, in wrapper
  Module <string>, line 4, in manage_assignRoleToPrincipals
  Module AccessControl.requestmethod, line 88, in _curried
  Module Products.PluggableAuthService.plugins.ZODBRoleManager, line 422, in manage_assignRoleToPrincipals
  Module Products.PluggableAuthService.plugins.ZODBRoleManager, line 304, in assignRoleToPrincipal
TypeError: '<' not supported between instances of 'str' and 'list'

It looks like the role is not being passed properly. As a hint, the page contains the title "Assign Role: Manager (Properties)" until I do a search in which case it turns into "Assign Role: ['Manager', 'Manager'] (Properties)". A debug trace at this location shows

(Pdb) role_id
["['Manager', 'Manager']", "['Manager', 'Manager']"]
dataflake commented 4 years ago

Duplicate of #43 and #51 . Fix was released with version 2.1.