public
Description: An authorization and workflow mechanism built on top of restful_authentication
Home | Edit | New

Home

A succinct guide to getting started

(assuming you have restful authentication setup already)


  1. If you’re using submodueles:

    git submodule add git://github.com/jbarket/restful-authorization.git vendor/plugins/restful-authorization

    otherwise:

    script/plugin install git://github.com/jbarket/restful-authorization.git

  2. ./script/generate authorized role user

  3. At the top of a controller (probably AdminController, if you have one), add:

    authorize_role “pro”, where pro is whatever role you want to require

  4. In the console:
    
    u = User.find(123) where 123 is whatever user you want to make an admin
    r = Role.create!(:name => "pro")
    u.roles << r
    </pre>
  5. That’s it
Last edited by mischa, Tue Sep 16 17:29:38 -0700 2008
Home | Edit | New
Versions: