def allowed(self, context, perm):
        if not hasattr(context, '__acl__'):
            acl = context
            context = MagicMock()
            context.__acl__ = acl
            context.__parent__ = None
        return self.auth.principals_allowed_by_permission(context, perm)
Get all allowed principals from a context or an ACL
dataset/ETHPy150Open mathcamp/pypicloud/tests/test_access_backends.py/BaseACLTest.allowed