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
We have the following STI inheritance: Toyota < Car
Setting the rules:
can :read, Car cannot :read, Toyota
Checking the roles:
can? :read, Car # results to false
can? :read, Car # should be true
Because we granted an access to all types of Car except Toyota
Rails version: 7.0.2
Ruby version: 3.0.3
CanCanCan version: 3.3.0
The text was updated successfully, but these errors were encountered:
There is currently an open pull request: #689 which should fix this issue.
Sorry, something went wrong.
Seems that this issue is not still fixed. There is the test in repo but it works only for non-STI relation:
it 'cannot rules are not effecting parent class' do u1 = User.create!(name: 'pippo') ability = Ability.new(u1) ability.can :manage, Parent ability.cannot :manage, Child expect(ability).not_to be_able_to(:index, Child) expect(ability).to be_able_to(:index, Parent) end
If we have Child inherited from Parent using STI, this would not pass.
No branches or pull requests
Steps to reproduce
We have the following STI inheritance: Toyota < Car
Setting the rules:
Checking the roles:
can? :read, Car # results to false
Expected behavior
can? :read, Car # should be true
Because we granted an access to all types of Car except Toyota
Actual behavior
can? :read, Car # results to false
System configuration
Rails version: 7.0.2
Ruby version: 3.0.3
CanCanCan version: 3.3.0
The text was updated successfully, but these errors were encountered: