Forums / Developer / Limit classes that can be created in a subtree

Limit classes that can be created in a subtree

Author Message

Willo van der Merwe

Monday 21 June 2004 1:55:25 am

Hi,

We're trying to build a site that allows the user to add content from the front end, but each folder should contain a certain set of classes only. How do we go about enforcing this? I've had a look at the different data types, but none seem to allow this.

Regards

Willo van der Merwe

James Packham

Monday 21 June 2004 3:56:09 am

Have a look at the role module - in the admin interface under user tab. This lets you specify what users can and cannot do.

Regards,

James

Willo van der Merwe

Tuesday 22 June 2004 12:17:48 am

Hi James,

Ok, I didn't think of using the roles and sections. That could work.

How do I conditionally add the "Add a new XXX" button depending on the role rights? I don't want to hard code it into the section template, as I'd like the admin to be able to define new classes on the fly.

Any help would be apreciated.

Willo van der Merwe

Vidar Langseid

Tuesday 22 June 2004 2:18:26 am

When you have the nodeobject, you can do like this to get a list of classes you have permission to create:

{$node.object.can_create_class_list|attribute(show)}

Willo van der Merwe

Thursday 01 July 2004 3:16:40 am

That's great but according to http://ez.no/community/bug_reports/node_object_can_create_class_list_does_not_honor_role_settings it's not going to honour the node settings. How am I going to get round this?