We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've found a very weird idiosyncrasy in the case that the Subject does not exist (checking for creation permissions is a good example of this).
Here's a rule pack:
def self.allowed(viewer, user) rules = [] if viewer.is_admin? rules << :create_user end return rules unless user.instance_of?(User) # more rules here return rules end
The above rule pack is IGNORED if used as written (declaration before the instance type check)
However, if I change the conditional statement to if viewer && viewer.is_admin? it works.
if viewer && viewer.is_admin?
I have no idea WHY this occurs, but it is a very strange thing and it had me pulling my hair out trying to get this gem to work properly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've found a very weird idiosyncrasy in the case that the Subject does not exist (checking for creation permissions is a good example of this).
Here's a rule pack:
The above rule pack is IGNORED if used as written (declaration before the instance type check)
However, if I change the conditional statement to
if viewer && viewer.is_admin?
it works.I have no idea WHY this occurs, but it is a very strange thing and it had me pulling my hair out trying to get this gem to work properly.
The text was updated successfully, but these errors were encountered: