0
votes

In Symfony CMF there is a PublishableInterface. This seem to only handle whether a node is published but is not meant to function as Role based security. Or is it?

Let's say I want a specific StaticContent page to only be accessible, and only show in menus if the user has a role ROLE_PREMIUM_CONTENT.

How to implement a role requirement for Symfony CMF content or routes?

1

1 Answers

1
votes

You can write your own publish workflow voters and tag them with cmf_published_voter - inject the security into the voter and let it decide on documents. you can add your own interface of course, for example to let the document specify which role it requires. menu entries are automatically hidden when the linked content is not published.

the details are explained in the documentation: http://symfony.com/doc/current/cmf/bundles/core/publish_workflow.html#publish-voters