You are here: Home Articles Developing with Plone 3 - borg.localrole and borg.project
OpenID Log in


Developing with Plone 3 - borg.localrole and borg.project

by Martin Aspeli last modified Aug 23, 2007 08:05 AM

Some brand-spanking-new code

Yesterday and today, I did something I’ve been wanting to do for a long time - refactor the more generic bits of b-org out into more generic components. I have the luxury of targeting Plone 3.0 only, so I could use a lot of new APIs and components only available there. The results are:

  • borg.localrole - a standalone release of the PAS plug-in which allows you to define local roles in an adapter. This will probably work on Plone 2.5, but on its own it does nothing.

  • borg.project - an easy-to-use implementation of the “project workspace” metaphor.

The latter is possibly more interesting. When you install it, a manager can add a new Project, and configure a list of managers (who get the Manager role); a list of members (who get the TeamMember role); and a list of content types which project members will be able to add inside the workspace. There is also a local workflow policy (using CMFPlacefulWorkflow - watch out, you need to install this manually now in Plone 3).

This is no different to what the same part of b-org did, except:

  • It’s completely standalone

  • It works on any kind of user, not just Membrane ones

  • It has few dependencies - it doesn’t need Membrane; in fact, it doesn’t even use Archetypes.

  • It shows off a number of cool Plone 3-like features, such as add forms, formlib-based edit forms, factories, browser views, events and doctests

I know the Teamspace guys have been working on similar things (such as team spaces working with plain members). From what I know, Teamspace is more powerful and ambitious, possibly also a bit more complex. I must admit that the ability to work against plain Plone 3, starting from a clean slate was a strong driving force. I got to exercise a lot of things that we want people to be able to do - I even fixed a few Plone 3 bugs in the process, which I probably wouldn’t have found before the release otherwise.

Both projects are in the Cheesehop. Both have README.txt files with doctests and background info. If you want to see how you may code against Plone 3, or you need a simple, lightweight project workspace, give it a go!

If you just want to have a browse of the code, look in the Collective.

Document Actions

Hmm, tryiing it out

Posted by at Feb 07, 2008 07:22 PM
Adding borg.project to buildout.cfg:

$ svn diff buildout.cfg
— buildout.cfg (revision 24)
+++ buildout.cfg (working copy)
@@ -21,6 +21,7 @@
eggs =
+ borg.project

# Reference any eggs you are developing here, one per line
# e.g.: develop = src/my.package
@@ -72,6 +73,7 @@
# e.g. zcml = my.package my.other.package
zcml =
+ borg.project

products =

This works, and I can add ‘borg.project’ (and dependencies) via QuickInstaller; after adding a “project workspace”, however, the “Edit” tab policy settings seem borked:

- The “search” and “update” buttons for managers and members are no-ops.

- The “addable types” list gets saved, but not enforced.

OK, I get it now (after UTSL)

Posted by at Feb 08, 2008 12:59 AM
The search widget is searching on
full name, rather than user ID: which is the fault of the package, rather than borg.project (it should search *both*).

Once I realize that, I could indeed add users to the workgroup folder. They still don't seem to be able to *see* the folder (which is still private), but I guess that is for another time.

Local roles not really granted

Posted by at Feb 11, 2008 02:02 PM
I have borg.project installed (1.1rc1, w/ borg.localrole 1.1rc2)
and can set up a project folder, including assigning users and groups. When I log in as one of the assigned users, however, I can't actually add content to the folder, although the add menu looks appropriately filtered.

When I look at the ZMI security tab for the folder, it doesn't appear that the local roles are actually granted to the members; if I do that manually, then adding content works. Am I missing womething?

Local roles - addition

Posted by at Feb 29, 2008 11:14 AM
I may have a similar problem :)
If admin adds a page and moves it into the project-private state, a team member X cannot see it.
The funny thing is:
>>> teammember.getRolesInContext(teamfolder)
['Member', 'Authenticated', 'Anonymous', 'TeamMember']
>>> teammember.getRolesInContext(testpage)
['Member', 'Authenticated', 'Anonymous', 'TeamMember']

>>> newSecurityManager(teammember, None)
>>> CP = mtool.checkPermission
>>> CP('View', testpage)
>>> CP('Access contents information', testpage)

But if I access the page through the browser, I get the text of the page (Title, Description, Body) but no portal context whatsoever. Looks like good old HTML 2.0. The source of the webpage reveals that e.g. no stylesheets are embedded, so access to portal_css seems to be blocked.

It looks like as if i do not have View and Access contents information after all.

If I give these permissions to the Member role via ZMI, I can see the object again.

Am I also missing something?

Best regards,
Plone Book
Professional Plone 4 Development

I am the author of a book called Professional Plone Development. You can read more about it here.

About this site

This Plone site is kindly hosted by: 

Six Feet Up