2010-12-09 20:01:39 +01:00
|
|
|
=========================
|
|
|
|
Permissions and Workflows
|
|
|
|
=========================
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
This document describes how plone.app.discussion handles permissions and
|
2010-09-24 15:35:21 +02:00
|
|
|
workflows.
|
|
|
|
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
plone.app.discussion uses permissions and workflows to control what a user is
|
2010-12-09 12:30:10 +01:00
|
|
|
allowed to do. It tries to use the default Plone permissions and workflow
|
|
|
|
engine as much as possible.
|
|
|
|
|
|
|
|
|
|
|
|
Permissions
|
|
|
|
===========
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
plone.app.discussion knows two permissions to control what a user is allowed to
|
|
|
|
do. The 'Reply to item' permission to control who is allowed to post a comment
|
|
|
|
on a content object and the 'Review comments' permission to control who is
|
2010-12-09 12:30:10 +01:00
|
|
|
allowed to review comments.
|
|
|
|
|
|
|
|
1) **Permission to post a comment**:
|
|
|
|
|
|
|
|
The permission to post a comment is controlled by the 'Reply to item'
|
2012-01-25 17:12:13 +01:00
|
|
|
permission. By default, this permission is granted to the 'Member',
|
2010-12-09 12:30:10 +01:00
|
|
|
'Reviewer', and 'Manager' role.
|
|
|
|
|
|
|
|
2) **Permission to review comments**:
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
The permission to review comments is controlled by the 'Review comments'
|
2010-12-09 12:30:10 +01:00
|
|
|
permission. By default, this permission is granted to the 'Reviewer' and
|
|
|
|
'Manager' role.
|
|
|
|
|
|
|
|
Changing permissions
|
|
|
|
--------------------
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
If you want to change the way plone.app.discussion allows users to post or
|
2010-12-09 12:30:10 +01:00
|
|
|
review comments you can do that by changing which permissions are granted to
|
|
|
|
which rules. In Plone permissions are always granted to roles, not to users
|
|
|
|
directly.
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
For instance, if you want to allow users without the 'Member' role to post
|
|
|
|
comments, you have to grant the 'Reply to item' permission to the
|
2010-12-09 12:30:10 +01:00
|
|
|
'Authenticated' role.
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
Or, if you don't want to allow 'Reviewers' to review comments anymore, you
|
2010-12-09 12:30:10 +01:00
|
|
|
can just remove the 'Review comments' permission from the 'Reviewer' role.
|
|
|
|
|
|
|
|
.. note:: For a general introduction to permissions and roles in Plone see:
|
|
|
|
|
|
|
|
http://plone.org/documentation/kb/understanding-permissions/permissions-and-roles
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-12-09 12:30:10 +01:00
|
|
|
http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/permissions
|
|
|
|
|
|
|
|
Workflows
|
|
|
|
=========
|
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
plone.app.discussion ships with a simple one-state
|
2010-10-15 16:49:54 +02:00
|
|
|
workflow and a review workflow for comments:
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
1) **Comment Single State Workflow**:
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
Essentially a workflow with no transitions, but it has a published state,
|
2010-09-24 15:35:21 +02:00
|
|
|
so portlets and applications that expect that state will continue to work.
|
2010-10-15 16:49:54 +02:00
|
|
|
|
2010-09-24 15:35:21 +02:00
|
|
|
2) **Comment Review Workflow**: A simple review workflow for comments
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
A simple review workflow that comes with two states (pending and published)
|
|
|
|
and a single transition (publish).
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
The 'pending' state is the initial state. 'published' is the state where the
|
|
|
|
comment is visible to everyone and non-editable.
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
The 'publish' transition is protected by the 'Review comments' permission.
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
::
|
2012-01-25 17:12:13 +01:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
* --> [pending] -- {publish} --> [published]--> *
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
.. note:: For a general introduction to workflows in Plone see:
|
2010-09-24 15:35:21 +02:00
|
|
|
http://plone.org/documentation/kb/creating-workflows-in-plone/
|
|
|
|
|
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
Custom comment workflow
|
2010-12-09 12:30:10 +01:00
|
|
|
-----------------------
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
You can create and enable any custom workflow on the "comment" content type.
|
2010-10-15 16:49:54 +02:00
|
|
|
Though, there are some special hooks in plone.app.discussion that check if the
|
|
|
|
workflow that is enabled for the "comment" content type has a 'pending' state in
|
|
|
|
order to do the following things:
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
1) A portal message will be shown to the user after posting a comment, if
|
|
|
|
the comment just entered the 'pending' state.
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2012-01-25 17:12:13 +01:00
|
|
|
2) A message is shown to the user if he/she accesses the bulk moderation view
|
2010-10-15 16:49:54 +02:00
|
|
|
and workflow is enabled for comments that does not implement a 'pending'
|
|
|
|
state.
|
2010-09-24 15:35:21 +02:00
|
|
|
|
2010-10-15 16:49:54 +02:00
|
|
|
3) A moderator will only be emailed when comment moderation is enabled in the
|
|
|
|
discussion control panel and the comment workflow contains a 'pending'
|
2012-01-25 17:12:13 +01:00
|
|
|
state.
|
|
|
|
|
2010-09-24 15:35:21 +02:00
|
|
|
|