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

[Feature request] Resources with strict role #555

Open
gabriel-curtino opened this issue Mar 12, 2021 · 0 comments
Open

[Feature request] Resources with strict role #555

gabriel-curtino opened this issue Mar 12, 2021 · 0 comments

Comments

@gabriel-curtino
Copy link

May worth to complement the strict mode for resources too, like this:

class Forum < ActiveRecord::Base
  resourcify strict: true
end

@user = User.first
@user.add_role(:admin, Forum.first) #=> ok
@user.add_role(:admin, Forum) #=> Exception?

This can work, in fact, as a security enforcement allowing only role assignment over instances.

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

1 participant