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

Allow subclasses to match on superclass subject #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrochkind
Copy link
Contributor

if Bicycle < Vehicle, and you have a policy can :read, Vehicle, then already can?(:read, Vehicle.new) and can?(:read, Bicycle.new) are both true.

can?(:read, Vehicle) is also true.

I believe can?(:read, Bicycle) should also be true, it should respect the subclass. Bicycle is a kind of Vehicle, so if they have been granted permission to read all Vehicles, that applies to all Bicycles too.

Closes #55, see more there.

if Bicycle < Vehicle, and you have a policy `can :read, Vehicle`, then already `can?(:read, Vehicle.new)` and `can?(:read, Bicycle.new)` are both true.

`can?(:read, Vehicle)` is also true.

I believe `can?(:read, Bicycle)` should also be true, it should respect the subclass. Bicycle is a kind of Vehicle, so if they have been granted permission to read all Vehicles, that applies to all Bicycles too.

Closes chaps-io#55, see more there.
@pokonski
Copy link
Contributor

pokonski commented Dec 8, 2022

Thank you for this, definitely an oversight!

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

Successfully merging this pull request may close these issues.

class inheritance, and class as test subject
2 participants