-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Milestone
Description
Hoping someone can help me shed some light on how to accomplish this, I'm more then likely looking at this all wrong. Any suggestions / help appreciated.
Works if you just specify one single record as the resource
if user.has_role? :company_admin, Company.first
...
end
How can you specify multiple resource id's? Example Company 1, Company 2, Company 3?
i.e.
if user.has_role? :company_admin, Company.all
...
end
I was actually trying to do this:
if user.has_role? :company_user, Company.with_role(:company_user, user)
can :manage, Derp
...
end
Then I found has_any_role?, however I can't find any solid examples on how I could pass Company.all or using my example above Company.with_role(:company_user, user) to it.
Thanks
Metadata
Metadata
Assignees
Labels
No labels