Customizing roles on the sharing tab in 3.0.2
optilude at gmx.net
Sun Oct 21 00:35:01 UTC 2007
Derek Richardson wrote:
> Hey. I'm upgrading from 2.5.1 to 3.0.2 and have sharing tab issues.
> My current (2.5.1) site uses roles 'Reader', 'Writer', and 'Owner'. These show
> on the sharing tab and all my users understand them.
> When I migrate to 3.0.2, I get 'can add', 'can edit', 'can view' and 'can
> review'. My users will not understand these (my users have limited adaptive
> So, I want to revert to the old roles. I know I can add them as utilities ala
> localroles.py and configure.zcml in plone.app.workflow. That's the note on page
> 85 of _Professional Plone Development_. (Thanks jonstahl for pointing me at this
> The trick seems to be, not adding my new/old roles, but deleting the old/new
> roles (the ones added in 3.0). I can write python code to unregister the
> utilities (I think...). I know of no zcml directive to unregister a utility.
There isn't an official one, though zc.configuration has some "turn off"
> This seems like a difficult (and, security-wise, somewhat scary) road to travel.
> Is there a better way of accomplishing what I want ('Reader', 'Writer', and
> 'Owner' replacing 'can add', 'can edit', 'can view', and 'can review')?
The easiest way is with overrides.zcml. A slightly cleaner way is local
utilities. In both cases, you create a new utility which can rename the
role and/or give admin rights over it e.g. only to the Manager role (so
that it's effectively hidden). A slightly more hacky way would be to
restrict management of a particular local role to a role that doesn't
exist, so that no-one sees it.
> BTW, what use is seeing the 'can add' role on the sharing page of an ATDocument?
> This is an aside, but it struck me as strange and somewhat confusing...
No real use, but it'd be hard to predict all the situations in which a
role is non-sensical, so we can't make them conditional like that.
By the way - the Editor, Contributor, Viewer roles (whatever you want to
call them) are pretty fundamental and useful in Plone 3. I'd advice you
against disabling them.
Oh - and we should have a control panel to make this stuff TTW-mangable.
It's on my list for 3.1 if I can get to it (we didn't have time for 3.0)
but if someone wants to help ... :)
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Product-Developers