Yeah,  It can be confusing - a few of tips:

1 ) Check out what credentials your current user has by using the dev  
panel.

You'll need to be using your application in dev mode ( something like  
backend_dev.php ) and then look in:

vars & config > Settings > credentials

that should give you a list of credentials.

Mine looks like:

>     credentials:
>       -
>         - Content_Create_Edit
>         - Content_Delete
>         - Content_Browse
>         - Content_Edit_Navigation
>         - Content_Copy_Paste
>         - Content_Add_To_Publish_Queue
>         - Content_Publish

Make sure the items in that list correspond to what your trying to  
configure in security.yml

2 ) Also make sure you understand the AND / OR syntax:

http://www.symfony-project.org/book/1_0/06-Inside-the-Controller-Layer#Complex%20Credentials

> delete:
>  is_secure:   on
>  credentials: [Can_Delete_Own, can_delete_any, admin]


taking this as an example - you're user will need to have -  
Can_Delete_Own AND can_delete_any AND admin credentials to get access  
to that action.

if you had double [[...]]  it would be OR.

For example:

> delete:
>   is_secure:   on
>   credentials: [[Can_Delete_Own, can_delete_any, admin]]


3 ) Make sure your indentation is correct.

Not sure if its just the email, but there should be two spaces of  
indentation for is_secure and credentials, the example sent through  
only had one.

As I said, that might just be a copy / paste thing.

Hope that helps.


On 24/06/2008, at 4:37 PM, Ady (WK) wrote:

>
> Thanks Piers! That helped a lot.
>
> OK, now to go on from that to the credentials...
>
> I have created 'permissions' that say can_book, can_delete and so on
> in the sfGuardPermission table.
>
> I have then created groups staff and student in sfGuardGroup with the
> relevant permissions
>
> The problem is that when I do:
>
> delete:
>  is_secure:   on
>  credentials: [Can_Delete_Own, can_delete_any, admin]
>
> create:
>  is_secure:   on
>  credentials: [Can_Book, admin]
>
> all:
>  is_secure:   off
>
> it says I do not have the correct credentials...
>
> hmmm
>
> This is the 1st time I have done this, so on the steep learning curve.
>
> Ady
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to