tags:

views:

674

answers:

1

Hi,

I have three tables forming a many-to-many relationship. They are,

WebUserRole -> WebUserRolePermission <- WebUserPermission

I've just started doing the admin for my WebUserRole object (using the propel:generate-admin), and I want the form for the WebUserRole to list the permissions with a check box next to each.

Now, is there a built in widget/way of doing this properly? Or will it require a bit of manual tinkering? Links to examples/tutorials are very welcome!

Thank you.

+1  A: 

I believe the widget you're looking for is sfWidgetFormPropelChoiceMany and you construct it with a model to pull the list from:

$this->widgetSchema['permissions_list'] => new sfWidgetFormDoctrineChoiceMany(array('model' => 'WebUserPermission'));

If you haven't seen it yet you should really check out the sfGuardPlugin mentioned by prodigitalson, it is a very robust authentication system with built-in custom permission management.

Cryo
That widget sounds like what I'm looking for, cheers. As for the sfGuardPlugin, we use to use it, but our requirements have exceeded what it can offer.
Stephen Melrose