Disallow change of nodeType


(Peter Rauber) #1

Hey guys

I try to prevent the editors from changing certain nodeTypes via the property editor. For that reason I added a privilegeTarget:

  'Neos\ContentRepository\Security\Authorization\Privilege\Node\EditNodePropertyPrivilege':
    'Internezzo.Neos:ChangeTypeOfAdminManagedNodes':
      matcher: 'nodePropertyIsIn(["hidden", "_nodeType"]) && nodeIsOfType(["Internezzo.Neos:SomeDocumentNodeType"])'

I GRANT permission to this for the admins and it working as expected for the hidden-property or any other property I use in the matcher: The editors get an error when they try to change the property and the admins can do it.

But: for the property “_nodeType” this is not working. I also tried “nodeType”, same result.

Shall I open a bug report or am I just doing something wrong?


(George Dimitriadis) #2

Thanks for your post, I was looking for a way to restrict my property.
Confirmed about _nodeType, it is not affected by the above rule. A workaround if you need to block everyone is to set the property to disabled.

properties:
  _nodeType:
    ui:
      inspector:
        editor: 'Neos.Neos/Inspector/Editors/TextFieldEditor'
        editorOptions:
          disabled: true