Commit 12e8b5ba authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: AccessControl users_with_local_roles() returns a dict_keys() instead of a...

py3: AccessControl users_with_local_roles() returns a dict_keys() instead of a subscriptable object.

Submitted upstream:
  https://github.com/zopefoundation/AccessControl/pull/128
parent bdec8612
...@@ -104,6 +104,8 @@ import zope.interface ...@@ -104,6 +104,8 @@ import zope.interface
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from zLOG import LOG, INFO, ERROR, WARNING from zLOG import LOG, INFO, ERROR, WARNING
import six
_MARKER = [] _MARKER = []
class PersistentContainer(Persistent): class PersistentContainer(Persistent):
...@@ -1887,6 +1889,9 @@ class Base( ...@@ -1887,6 +1889,9 @@ class Base(
if 'Owner' in rolesForPermissionOn(Permissions.View, self): if 'Owner' in rolesForPermissionOn(Permissions.View, self):
owner_list = self.users_with_local_role('Owner') owner_list = self.users_with_local_role('Owner')
if owner_list: if owner_list:
# https://github.com/zopefoundation/AccessControl/pull/128
if not isinstance(owner_list, (tuple, list)):
owner_list = tuple(owner_list)
return owner_list[0] return owner_list[0]
# Private accessors for the implementation of relations based on # Private accessors for the implementation of relations based on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment