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

Cannot define class based rule #10

Open
mattupstate opened this issue Dec 11, 2014 · 2 comments
Open

Cannot define class based rule #10

mattupstate opened this issue Dec 11, 2014 · 2 comments

Comments

@mattupstate
Copy link

I see in the code that the behavior when the subject is a class instance the condition always returns True. I want a specific type of user to be able to CREATE instances of a resource/model but others to not be able to. For example:

they.can(
    READ, Model,
    lambda r: is_member(r) or is_staff(r))

they.can(
    EDIT, Model,
    lambda r: is_member(r) or is_staff(r))

they.can(
    (CREATE, DELETE), Model,
    lambda r: is_staff(r))

I only want "staff" to be able to CREATE and DELETE instances of the Model. However, there does not seem to be a way to do this. The last rule's condition function is never called. What am I not understanding?

@alexcc4
Copy link

alexcc4 commented Sep 22, 2017

Meet it, too.
It seems that this repo is not maintained by anyone. No any update.

@cadiven
Copy link

cadiven commented Oct 9, 2017

I think so.

Found another repo: https://github.com/cocoakekeyu/cancan

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

3 participants