My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
             
Search
for
Updated Feb 04 (5 days ago) by timcharper
Labels: Featured
Documentation  

Introduction

Documentation Home

Contents


Comment by hkairi04272, May 30, 2008

it's a nice plugin !

Comment by noonchildrecords, Jun 09, 2008

This doesn't work for me.

thodError in UsersController?#index

You have a nil object when you didn't expect it! The error occurred while evaluating nil.has_role?

This looks like exactly what I need except it looks like I will have to write it myself. Ah well. A link to the source code, maybe?

Comment by jacksenechal, Sep 02, 2008

I've just installed the plugin and followed the instructions on the main page, but I'm confused about where to go now. How do I add roles to users? Some more documentation would be very helpful. Thanks!

Comment by timcharper, Sep 02, 2008

agreed

just insert them into your database. Use a migration.

Comment by chewmanfoo, Nov 12, 2008

TIm,

How do you do this within a rails app, or in the console? Here's what I tried:

trunk?# script/console Loading development environment (Rails 2.1.2) >> r_u = RolesUsers?.new :role_id => 1, :user_id => 13 NameError?: uninitialized constant RolesUsers?

from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/
dependencies.rb:279:in `load_missing_constant'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/
dependencies.rb:468:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/
dependencies.rb:480:in `const_missing'
from (irb):4

I need to add a role to a user after /signup, but I can't figure out how to do that.

TIA,

Comment by ramaguru, Jan 12, 2009

Good one... So, now i have restful_authentication for authentication and rolerequirement for role based access control. Rolerequirement supports hardcoded resources and actions for roles.

How about, a dynamic user defined, resource and action for roles?

Comment by mich...@moulsdale.com, Jan 31, 2009

Nice plugin. One query, how can I add a redirection if the user does not have the correct role?

Comment by timcharper, Jan 31, 2009

Yes, look in the generated role_requirement.rb, under the access_denied method.

Comment by mcdba4, Feb 18, 2009

re: chewmanfoo,

u=User.find(1) r=Role.new r.name="admin" r.save

u.roles << Roles.find_by_name("admin")

Comment by brianjdoherty, Apr 23, 2009

Typo in comment above: the last line should say u.roles << Role.find_by_name("admin")

Comment by ericghill, Aug 20, 2009

where is the documentation?


Sign in to add a comment
Hosted by Google Code