Monday, 9 September 2013

CanCan prevent non-authorized users from going to URL

CanCan prevent non-authorized users from going to URL

I am reading through CanCan documentation and I see it's possible to grant
granular resource level restrictions/authorization. My problem is slightly
easier. I just need to prevent anyone who's not a particular class of user
from accessing a URL. So for instance, say I have an /admin URL on my
Rails app. I only want those users that have an admin role to be able to
go there and redirect those who aren't to the home page, is CanCan capable
of handling this type of granularity as well?

No comments:

Post a Comment