Skip to content

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