I took a look and it seems that is how it behaves. I dunno if that is
intended or not, but I don't think it should be that way. In the Doctrine
version of the plugin, sfDoctrineGuardPlugin, it behaves the way you are
expecting. It makes sure the explicit permissions and permissions through
groups are loaded to check against.

- Jon

On Tue, Oct 21, 2008 at 5:22 AM, Alex 'noetix' Joyce <
[EMAIL PROTECTED]> wrote:

>  Anyone?
>
>
>
> *From:* [email protected] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Alex 'noetix' Joyce
> *Sent:* Sunday, 19 October 2008 11:05 PM
> *To:* [email protected]
> *Subject:* [symfony-users] sfGuard - Permissions & Groups
>
>
>
> Hi,
>
>
>
> I'm under the understanding that:
>
>
>
>  - users can belong to many groups.
>
>  - users can have many permissions.
>
>  - groups can have many permissions.
>
>  - users within groups have permissions associated to that group.
>
>
>
> Example:
>
>
>
> User
>
>                 Group
>
>                                 Permission X
>
>                 Permission Y
>
>
>
> This user would have X & Y permissions.
>
>
>
> Here are my results:
>
>
>
>                 $sf_user->hasPermission('X'); // returns FALSE
>
>                 $sf_user->hasPermission('Y'); // returns TRUE
>
>
>
>                 $sf_user->getAllPermissionNames(); // returns array(X,Y)
>
>
>
> After looking at the code, when you execute hasPermission for the first
> time it loads up user permissions only.
>
> When you execute getAllPermissionNames, it also includes the group
> permissions.
>
>
>
> Is this as expected?
>
>
>
>
>
> Thanks
>
> Alex Joyce
>
>
>
>
> >
>


-- 
Jonathan H. Wage
Open Source Software Developer & Evangelist
http://www.jwage.com
http://www.doctrine-project.org
http://www.symfony-project.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
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