[SOLVED Read_permission(), write_permission() without effect for non-Managers

I have this schema for a content type:

class IDeclaration(model.Schema):
    """ Marker interface and Dexterity Python Schema for Declaration
    """

    read_permission(author_id=permissions.ManagePortal)
    write_permission(author_id=permissions.ManagePortal)
    author_id = schema.TextLine(
            title=_("Author ID"),
            required=True)

    read_permission(author_name=permissions.ManagePortal)
    write_permission(author_name=permissions.ManagePortal)
    author_name = schema.TextLine(
            title=_("Author Name"),
            required=True)

The standard edit view of Plone renders the fields both for the accounts with Manager and Editor roles. My expectation is that the fields are only available for Managerbut not for Editor.
Anything missing?

The permissions object in your code sample is coming from which module?
Plone 5.2?

Wilde idea, maybe the user you are testing with is also Owner and that translates into Manager? Still I wouldn't expect Editor permission being equal/confused with ManagePortal.

The old trap: you need to specify the permissions with their dotted name like cmf.ManagePortal instead of the old-style permission names like Manage Portal (imported from Products.CMFPlone.permissions).

3 Likes