Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ILocalRolesPlugin plugin breaks api.user.get_roles #458

Open
batlock666 opened this issue May 3, 2021 · 0 comments
Open

Custom ILocalRolesPlugin plugin breaks api.user.get_roles #458

batlock666 opened this issue May 3, 2021 · 0 comments

Comments

@batlock666
Copy link

I have a custom PAS-plugin that implements interface ILocalRolesPlugin. To my surprise, this plugin breaks api.user.get_roles. Most of the time it works, but when I call the function like this:

api.user.get_roles(username=username, obj=obj, inherit=False)

I get the following exception:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/bvderbau/Projects/plone5.2-pcm2052-emptysharing/tryout.py", line 21, in <module>
    roles = api.user.get_roles(username=username, obj=obj, inherit=False)
  File "<decorator-gen-35>", line 2, in get_roles
  File "/home/bvderbau/.buildout/eggs/cp36m/plone.api-1.10.4-py3.6.egg/plone/api/validation.py", line 116, in wrapped
    return function(*args, **kwargs)
  File "/home/bvderbau/.buildout/eggs/cp36m/plone.api-1.10.4-py3.6.egg/plone/api/user.py", line 258, in get_roles
    for adapter in lrmanager._getAdapters(obj):
AttributeError: _getAdapters

It seems the problem is that my plugin is missing the method _getAdapters. This method is not required by the ILocalRolesPlugin interface. The only local roles plugin that has this method is in package borg.localrole. Are we supposed to use borg.localrole to assign local roles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant