Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Serializing to Catalog the deny permissions and return the complete URL
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodbare committed Nov 28, 2016
1 parent f7585d8 commit b48a808
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/plone.server/plone/server/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from zope.schema import getFields
from zope.securitypolicy.principalpermission import principalPermissionManager
from zope.securitypolicy.rolepermission import rolePermissionManager
from zope.securitypolicy.settings import Allow
from zope.securitypolicy.settings import Allow, Deny


globalPrincipalPermissionSetting = principalPermissionManager.getSetting
Expand Down Expand Up @@ -125,6 +125,8 @@ def __call__(self):
'uuid': self.content.uuid,
'accessRoles': [x for x in roles if roles[x] == Allow],
'accessUsers': [x for x in users if users[x] == Allow],
'denyedRoles': [x for x in roles if roles[x] == Deny],
'denyedUsers': [x for x in users if users[x] == Deny],
'path': path,
'portal_type': self.content.portal_type
})
Expand Down
4 changes: 1 addition & 3 deletions src/plone.server/plone/server/json/serialize_content.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# -*- coding: utf-8 -*-
from plone.server.interfaces import IContainer
from plone.server.interfaces import IResource
from plone.server.content import iterSchemata
from plone.server.json.interfaces import IResourceFieldSerializer
from plone.server.json.interfaces import IResourceSerializeToJson
from plone.server.json.interfaces import IResourceSerializeToJsonSummary
from plone.server.interfaces import IAbsoluteURL
from plone.server.content import getCachedFactory
from plone.server.json.serialize_value import json_compatible
from plone.server.browser import get_physical_path
from plone.server.interfaces import READ_PERMISSIONS_KEY
from plone.server.directives import mergedTaggedValueDict
from zope.component import adapter
Expand Down Expand Up @@ -47,7 +45,7 @@ def __call__(self):
parent_summary = {}

result = {
'@id': '/'.join(get_physical_path(self.context)),
'@id': IAbsoluteURL(self.context, self.request)(),
'id': self.context.id,
'@type': self.context.portal_type,
'parent': parent_summary,
Expand Down

0 comments on commit b48a808

Please sign in to comment.