Control access on future content

筅森魡賤 提交于 2019-12-02 01:41:17

there is an addon product that does exactly what you need:

collective.wfeffectiverange

it works by adding a cron job that looks for not yet published (effective date in the future) or expired (expiration date reached) content and apply a workflow transition in this case.

see https://pypi.python.org/pypi/collective.wfeffectiverange for more information

1.) Create a contenttype per privilege-level you want to have ('premium', 'paid subscriber') and assign a dedicated workflow to each, holding at least the states 'editors-review' and 'premium-published', respectively 'editors-review' and 'paidsub-published', and wire the states to equivalent roles ('editors', premiumusers', 'paidsubscribers'), to grant the View-permissions, as intended. Additionally it is recommandable to create a group for each role, wire them together, and assign the users to the groups, instead to roles.

2.) Use collective.contentrules.comingsoon to apply a contentrule which sets the state from 'editors-review' to 'premium-published', respectively 'editors-review', when the publishing-date is met (executed via a browserview, triggered of a cron).

3.) To overcome Plone's default setting, that items with a publish-date set in the future won't appear in navi-elements, you need to customize/override the refering templates. That'll include globalnav, navportlet, sitemap, folder_listing, etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!