plone / plone/plone.api

api.group.get_roles() fails with AutoGroup

Open
#350 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 type: bug
Dominant language
Python
Stars
101
Forks
62
Avg merge
15h 15m
Merged PRs (30d)
1

Description

getting local roles fails for the AutoGroup 'AuthenticatedUsers' :

Error in test test_local_roles_without_inheritance_for_builtin_groups (plone.api.tests.test_group.TestPloneApiGroup)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 398, in debug
    getattr(self, self._testMethodName)()
  File "/Users/philip/workspace/kbo/src-mrd/plone.api/src/plone/api/tests/test_group.py", line 574, in test_local_roles_without_inheritance_for_builtin_groups
    api.group.get_roles(groupname='AuthenticatedUsers', obj=folder, inherit=False)
  File "<decorator-gen-53>", line 2, in get_roles
  File "/Users/philip/workspace/kbo/src-mrd/plone.api/src/plone/api/validation.py", line 100, in wrapped
    return f(*args, **kwargs)
  File "<decorator-gen-52>", line 2, in get_roles
  File "/Users/philip/workspace/kbo/src-mrd/plone.api/src/plone/api/validation.py", line 131, in wrapped
    return f(*args, **kwargs)
  File "/Users/philip/workspace/kbo/src-mrd/plone.api/src/plone/api/group.py", line 235, in get_roles
    lrmanagers = plone_user._getLocalRolesPlugins()
AttributeError: 'super' object has no attribute '_getLocalRolesPlugins'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with plone/api/group.py at get_roles and the failing test test_local_roles_without_inheritance_for_builtin_groups in plone/api/tests/test_group.py. Reproduce the AuthenticatedUsers case with inherit=False and trace the reported _getLocalRolesPlugins failure. Done means the test passes and get_roles returns local roles without that exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authorization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.