Group Private Events
Configure your site to have events private by group.
Overview
With a default Plone install, when you add an event, it is visible to anyone else on the site. This is not always the desired behavior. This page describes what needs to be done to change this. It allows for any number of groups to have their own, group only visible events.
To accomplish this, we need to do the following:
- Setup the group.
- Add a new group (skip if using an existing one).
- Add a new role.
- Assign the role to the group.
- Modify the default Plone workflow.
- Add a new transition.
- Add a new state.
- Update the default state.
- Modify the calendar.
- Modify the events portlet.
Setup the group
Add the group to the site if it does not already exist.
Next, go to site setup, then to the ZMI, and click on the Security tab at the top. Scroll to the bottom of the page, and add a user defined role. Fill in the box, and click the add role button.
Now, go back to site setup, then to Users and Groups Administration, click the groups tab. Click the checkbox at the intersection of your group and your role, and then click the apply changes button.
That's it for the group and role.
Modify the default Plone workflow
Add a new state
When it comes to visibility in Plone, about your only option is limiting things based on role. You limit with a workflow. Out-of-the-box, plone has two workflows: folder_workflow and plone_workflow. Here, we're only concerned with the later.
Go to site setup, Zope Management Interface, and click on plone_worflows. Click on the contents tab. Click on plone_workflow, then the states tab. At the bottom of the page, put in a name for your new workflow, and click the add button.
Next, click your new state. This opens onto the Properties tab. Set what transitions are available from this new state. You probably want to click at least the reject and retract transitions. Do so, and then click the Save changes button.
Now click the Permissions tab at the top of the page. For the view permission, uncheck the Acquire permission settings? checkbox, then check the Owner, Manager, and your new role on the view line, and then click the Save changes button.
That's it for the state. Next, the transition.
Add a new transition
In the Workflow State at bread crumbs at the top of the page, click on states, then on the Transitions tab at the top of the page. Scroll down to the Add a transition area at the bottom of the page. Enter in a name for your transition. Something like 'publish role', where role is the new role you've added. Click the Add button.
Click your new transition. Enter in a tile ( I use 'Reviewer publishes role content'). Select your new state in the Destination state drop down. Trigger type should be Initiated by user action. In the Role field of the Guard area, type in the name of your new role. In the Display in actions box area, enter the name you want displayed in the state transition drop down in the Name field. In the URL field, enter '%(content_url)s/content_publish_form' (I simply copied this from the publish transition). Click the Save changes button.
That's it here. In the Workflow Transition at bread crumbs at the top of the page, click transitions.
Modify the default state
We want our new transition to appear in the workflow drop down when adding an event. To do this, we must modify the default state.
Click the States tab at the top of the page. Now click the visible state. In the Possible Transitions area, select your new transition, and then click the Save changes button.
We're done with workflow. Unfortunately, the calendar and the events portlet are configured to only display items that are in the published state. We'll now change this.
Modify the calendar
The calendar is easy to change. Thankfully, someone thought that somebody would want to display items in the calendar in states other than published.
To change the calendar, go to the ZMI (if you've just finished the previous step, simply click / in the bread crumbs at the top of the page) and click on portal_calendar. Click on the Configure tab at the top of the page. In the Workflow states to show in the calendar area, click in the entry box, hit return, and on the next line, enter your new state.
Modify the events protlet
Modifying the events portlet isn't hard, but does require access to the filesystem where Plone is installed.
Go to your Product directory, and open the file at CMFPlone/browser/portlets/events.py in a text editor. Find the published_events method. Yu should see a bit of code that looks like review_state='published'. Simply change it to review_state=('published', 'role published'), where role is your new role. Save the file and restart Zope.
Wrapping up
Now, when you add events (well, actually when you add any type), the workflow menu will show your new transition. Simply select it, and you have events that are viewable only by members of the group with the new role. As we modified the default workflow, every Plone type will have this transition. If you do not want that, clone the default workflow, give it a new name, and assign it to the Event content type. I chose not to do that, because my use case simply doesn't require it.
If you have any trouble, or I've left anything out, please let me know.

