[Zope-CMF] limiting types to add by role

Thomas Olsen tol@tanghus.dk
Wed, 28 Aug 2002 14:48:47 +0200


On Tuesday August 27 2002 19:21, Kelley, Sean wrote:
> I want to limit the list of addable content types by role. For example,=
 I
> want users in role X to only be able to add 5 things but let managers a=
dd
> all item types.  I tried changing the security in portal_types for each
> individual type to remove view except for manager.  This of course remo=
ved
> view capability for role x as well as well as the ability to add these
> types.  I still want them to see the type if the manager adds it.  How =
can
> this be accomplished?

The way we have accomplished that is:

1) Change the roles for permission 'View Folder Contents' to whatever you=
 like=20
(we've chosen Manager)

2) Create a 'portal_toolbox'. Maybe the name is not so intuitive but what=
 it=20
does is that it gives the member a small toolbar with icons representing =
the=20
different portal types available for creation. The content of this toolba=
r =20
is configured in the portal_toolbox from the zmi or from an CMF'ified edi=
t=20
form. For every portal type you can set which roles are allowed to create=
 an=20
object of that type.=20
The member can also limit the number of types in the toolbox.

This is only limited to what items are in the toolbox and doesn't use Zop=
e=20
security scheme. If the member has access to the folder_contents view he/=
she=20
can create whatever portal type listed there.

If you want I can supply some screenshots?

--=20
Regards,
=09Thomas Olsen