This project is read-only.

Can I use for an ad hoc zone?

Topics: Administration, Writing modules
Aug 26, 2013 at 9:51 PM
My overall question is what is the best way to control the same content item type with one role being for admin edit and another for web user edit?

I have a content part that I want to show all associated parts for in the admin dashboard, but suppress a few of the parts when allowing a non admin web user to edit the content. Essentially, I'm trying to find out how to reuse the same driver and edit views to handle the content for both roles.

I've managed to get the edit template to be displayed in both places, but I haven't had any success in being able to selectively filter the admin only parts out of the non admin view.
Aug 26, 2013 at 10:10 PM
Placement won't help with that. Your driver should check for permissions (you should always check permissions, almost never roles) and emit a different shape based on that.
Aug 26, 2013 at 10:33 PM
Thank you. That is good to know. I'm not sure what kind of shape to make, though. If I'm trying to hide a Body part, how would I do that?
Aug 26, 2013 at 10:38 PM
Now you're confusing me. You were talking about existing shapes, not your own? That sounds dangerous, as you don't necessarily know how the part you're hiding is going to react to lack of input when posted. I would rethink the scenario, but if you still want to proceed, you could implement a shape table provider and check what you need from there, and suppress the shape.
Aug 26, 2013 at 10:44 PM
Okay, I won't go down that road, then. So, it sounds like I'm back to my prior long hand approach where I'm defining a view model and transferring the values over on post back. Would that be a good approach?
Aug 27, 2013 at 1:30 AM
Maybe. I don't know nearly enough about your scenario to be able to say.