james2m / canard

Makes role based authorization in Rails really simple. Wraps CanCan and RoleModel up with a smattering of syntactic sugar, some generators and scopes.
MIT License
125 stars 28 forks source link

Get All Available Roles #25

Closed klipie245 closed 9 years ago

klipie245 commented 9 years ago

I'm trying to get the available roles for the user model defined, so I can display them in my view. I know with the role model gem I can call User.valid_roles to return all the available roles declared. Is there a way to do this with canard? If I do use ".valid_roles" on my user object it gives me an undefined method error.

Help with this will be appreciated

EDIT - my mistake, saw I was calling it on the user object instead of on the User model - is working now.