Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource paths sharing the same base. #4

Closed
kkthxbye opened this issue Sep 26, 2012 · 1 comment
Closed

Resource paths sharing the same base. #4

kkthxbye opened this issue Sep 26, 2012 · 1 comment
Assignees

Comments

@kkthxbye
Copy link

// Allow and Deny can be each set
$deputy->set_role('user', array
(
    'allow' => array
    (
        'forum',
        'forum/thread'
    ),
    'deny'  => array
    (
        'forum/thread/edit'
    )
));

var_export($deputy->allowed('forum')); // returns 'false'.

Is it supposed to be that way?

The problem is 'forum/thread/edit' breaks down as 'forum' => 'thread' => 'edit' and due to weird parse algorithm as soon as we get down to 'forum' while looking into 'deny' rules _get() function does return TRUE, which means it is in 'deny' list even thou it isn't.

morgan pushed a commit that referenced this issue Sep 30, 2012
a child would also deny any parents in the URI. Now explicitly looking for URI definition before
checking for wildcard.
@ghost ghost assigned morgan Sep 30, 2012
@morgan
Copy link
Owner

morgan commented Sep 30, 2012

Hello @kkthxbye,

Great find! When denying a child, Deputy_Role was taking into account the parent as well. I refactored this logic to explicitly look for the URI before checking for a wildcard.

This issue is resolved in current release 0.3.2.

Thank you,

Micheal Morgan

@morgan morgan closed this as completed Sep 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants