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

Can't have privileges with different conditions in the same permission block #195

Open
zeiv opened this issue Jul 8, 2014 · 0 comments
Open

Comments

@zeiv
Copy link
Contributor

zeiv commented Jul 8, 2014

For example, the following does not work:

has_permission_on :blog_posts do
    to :read
    to :manage do
        if_attribute blog: { user_id: is { user.id } }
    end
end

Instead, you have to do this, which is not as DRY (or readable):

has_permission_on :blog_posts, to: :read
has_permission_on :blog_posts, to: :manage do
    if_attribute blog: { user_id: is { user.id } }
end

Ideally, shouldn't all a role's privileges for an object be definable in one permission block?

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

1 participant