0

I am trying to fully understand how the credentials/permissions system works in symfony(1.4)

I have 2 groups and 2 users.

User 1 has the following permissions: Add.Car, Delete.Car

User 2 has the following permissions: Add.Bike, Delete.Bike

Now what I want to do, is only allow users with the Add.x permissions to be able to add to a category table.

The problem is, that If I have:

credentials: [Add.Car, Add.Bike] - it seems to look for users with BOTH of these, not either of them.

Is this how the credentials work and If so, is there a way to check if the user has either Add.Bike OR Add.Car before allowing them to create new records?

Thanks

terrid25
  • 1,926
  • 8
  • 46
  • 87

1 Answers1

2

Wrap the credentials in [ ]

credentials: [[Add.Car, Add.Bike]]

see http://www.symfony-project.org/jobeet/1_4/Doctrine/en/13 'Complex Credentials' section

d.syph.3r
  • 2,215
  • 1
  • 19
  • 14
  • Excellent. I knew I'd seen how to do it somewhere! – terrid25 Apr 13 '11 at 16:21
  • Perhaps here [Symfony Docu](http://www.symfony-project.org/gentle-introduction/1_4/en/06-Inside-the-Controller-Layer#chapter_06_sub_complex_credentials) :-) – domi27 Sep 09 '11 at 23:17