Collaboration through Sharing

*** Settings ***

Resource  plone/app/robotframework/server.robot
Resource  plone/app/robotframework/keywords.robot
Resource  Selenium2Screenshots/keywords.robot

Library  OperatingSystem

Suite Setup  Run keywords  Suite Setup  Test Setup
Suite Teardown  Run keywords  Test teardown  Suite Teardown

*** Variables ***

${FIXTURE}  plone.app.robotframework.PLONE_ROBOT_TESTING
@{DIMENSIONS}  1024  768
@{APPLY_PROFILES}  plone.app.contenttypes:plone-content


*** Keywords ***

Suite Setup
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Setup Plone site  ${FIXTURE}
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Open test browser
    Run keyword and ignore error  Set window size  @{DIMENSIONS}

Test Setup
    Import library  Remote  ${PLONE_URL}/RobotRemote

    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB SetUp  ${FIXTURE}

    ${language} =  Get environment variable  LANGUAGE  'en'
    Set default language  ${language}

    Enable autologin as  Manager
    ${user_id} =  Translate  user_id
    ...  default=jane-doe
    ${user_fullname} =  Translate  user_fullname
    ...  default=Jane Doe
    Create user  ${user_id}  Member  fullname=${user_fullname}
    Set autologin username  ${user_id}

Test Teardown
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB TearDown  ${FIXTURE}

Suite Teardown
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Teardown Plone Site
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Close all browsers

The Sharing item on the Toolbar empowers you to collaborate with other users through the use of several built-in roles.

Here, Jane Doe has created a Folder called “Documentation”, and has clicked on the “Sharing” option.

basic workflow menu

The default workflow for this Plone site has not been modified, so the folder is still “Private”. Only she can see the contents.

Now she wants to let her colleagues add content to the Documentation folder.

Taking a closer look at the available permissions, they are:

  • Can add - When this permission is granted to a particular user (or group of users), that user can then add new content items. And since that user was also the creator of that content item, they will be able to edit it as they like.
  • Can edit- When this permission is granted on a folder, the user can not only edit the Folder (its title and description) but can also edit any of the items in the folder. Note, however, the user is not allowed to delete any of the content. When this permission is granted on a Page, for example, the user can only edit that Page and none of the other items in the folder.
  • Can view - When this permission is used on a folder or other item, the user can view the content but not make any changes.
  • Can review - When this permission is granted, the user can publish items.

Note

Note: these permissions will override the default workflow permissions! For example, if you grant a user “Can view” permission on a Page that is in the Private state, that user will be able to see that Page.

Users and groups

Now, while it is handy to give one person the right permissions, it quickly becomes messy in a larger site.

Plone has a well-thought out system of User and Group management that can help. For instance, if you put the people that work on the Sports section of your news site into the group “Sport editors”, you can give them all the permissions they need at once.

And even more important, if Sally gets transferred from the Sports section to the Science section, you only have to remove her from one group, and add to another group, and all permissions on the whole site will work for her.

One final note: if the “Documentation” folder was not in the published state, and you had also not given your colleague the ‘view’ permission on the folder, but you had given that permission on a specific Page in this folder, he or she would have to know the exact URL to the Page to see it.

Permissions are very specific in Plone! In practice, it is usually clearer to give permission on a folder-by-folder base and not per document, as this becomes hard to maintain. Then again, if you need the permissions and the security to be this fine-grained, you can!