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!
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?
it's a nice plugin !
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?
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!
agreed
just insert them into your database. Use a migration.
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?
dependencies.rb:279:in `load_missing_constant' dependencies.rb:468:in `const_missing' dependencies.rb:480:in `const_missing'I need to add a role to a user after /signup, but I can't figure out how to do that.
TIA,
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?
Nice plugin. One query, how can I add a redirection if the user does not have the correct role?
Yes, look in the generated role_requirement.rb, under the access_denied method.
re: chewmanfoo,
u=User.find(1) r=Role.new r.name="admin" r.save
u.roles << Roles.find_by_name("admin")
Typo in comment above: the last line should say u.roles << Role.find_by_name("admin")
where is the documentation?