My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
Documentation  

Featured
Updated Feb 4, 2010 by timchar...@gmail.com

Introduction

Documentation Home

Contents

Comment by hkairi04...@gmail.com, May 30, 2008

it's a nice plugin !

Comment by noonchil...@gmail.com, Jun 9, 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 jacksene...@gmail.com, Sep 2, 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 project member timchar...@gmail.com, Sep 2, 2008

agreed

just insert them into your database. Use a migration.

Comment by chewman...@gmail.com, Nov 12, 2008

TIm,

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

[root@sourceden 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 ramag...@gmail.com, 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 michael%...@gtempaccount.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 project member timchar...@gmail.com, Jan 31, 2009

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

Comment by mcd...@gmail.com, 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 brianjdo...@gmail.com, Apr 23, 2009

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

Comment by ericgh...@gmail.com, Aug 20, 2009

where is the documentation?


Sign in to add a comment
Powered by Google Project Hosting