0

I wanted to know if it's possible to allow a user to fill (and edit) a class attribute (field within a class) only if he has a specific role.

A simple example :

I give the role "Classic" to user "A" which allow him to create a class Article and fill the attributes "Title" and "Author".

Now if I give the role "Premium" to user "B", I want him to be able to create the same class Article and fill the attributes "Title", "Author" AND "Description".

My problem is that I can't find anything related to class attribute when I create a policy...

Any idea on how to proceed ?

Oliboy50
  • 2,661
  • 3
  • 27
  • 36
  • 2
    Unfortunately, the eZ Publish permissions system does not offer object attribute constraints. Sorry to be a buzzkill. – harmstyler Apr 01 '14 at 15:29
  • I see, thank you. Have you a suggestion about what should I do to get something similar ? (duplicate classes with different fields or ... ?) – Oliboy50 Apr 02 '14 at 12:26
  • I don't typically follow that pattern but eZ's demo install does something similar, they have three different Article classes which you could do. However, the best answer is to set up an editorial workflow using object states to control when the content can be seen. Follow this tutorial: http://share.ez.no/learn/ez-publish/ez-publish-knowledge-series-editorial-workflow-with-object-states. – harmstyler Apr 03 '14 at 15:47

1 Answers1

0

You can create an override template for edit view of article (via override.ini.append.php file). In this template you will display only allowed attributes, filtering by user role.

So, you can configure roles and attributes mapping in a ini file.

Rey0bs
  • 1,192
  • 12
  • 19