Distinct permissions listed for items inheriting from OFS.Item and OFS.Folder

Hello all,

While implementing a new feature for a customer, I stumbled upon an interesting issue: After creating a new permission (Adding it via ZCML & configuring its default values with rolemap.xml), I noticed this new permission is not listed, on manage_access, for non-folderish content types (i.e: File, Image).

Also, If I try, via code, to access rolesOfPermission passing the new permission, I will get a ValueError (invalid permission) -- and the same happens if I try to set roles to the permission with manage_permission.

I would like to know where the list of available permissions for non-folderish content(inheriting from OFS.Item, not from OFS.Folder) is defined (as I want to add my permission to this list).

List of permissions for a File (OFS.Item)

List of permissions for a Folderish (OFSFolder)

Permissions definition

It seems all permissions listed for non-folderish content are defined in AccessControl.

Cheers,
ea

Ericof via Plone Community wrote at 2022-2-3 23:20 +0000:

While implementing a new feature for a customer, I stumbled upon an interesting issue: After creating a new permission (Adding it via ZCML & configuring its default values with rolemap.xml), I noticed this new permission is not listed, on manage_access, for non-folderish content types (i.e: File, Image).

Also, If I try, via code, to access rolesOfPermission passing the new permission, I will get a ValueError (invalid permission) -- and the same happens if I try to set roles to the permission with manage_permission.

Are you aware that Zope sees the permission's title not its id?

Yes, I am.

The question is, why are the listed permissions on SimpleItem (or non Folder) filtered (or incomplete) - or what does constrain it.

In fact there must be more valid permissions listed there, are am I wrong?

1 Like