authentication - Rails: Roles/admin -


prefface i'm new rails & programming. working on first rails app--i have authentication omniauth , devise , simple article submission working users.

i want 2 things:

  1. if user isn't specific role, reroute them page.

  2. if preference 'offline' allow admins view site.

i have yet create prefferences table--looking suggestions. :)

what's best way set simple roles? what's easiest way redirect users if they're not admin and if site 'offline'?

i'm using cancan role-based authorization on current project. i've found works great including ability both of you're looking for. , documentation! oh, documentation. if gem authors wrote documentation cancan's, believe bring world peace.

and added bonus, because written ryan bates, has railscast recorded it.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -