set administrator or moderator permissions to users in rail3 through the console

Tom Hughes tom at compton.nu
Fri Jul 20 16:25:09 BST 2012


On 20/07/12 15:38, Sergey Shilov wrote:

> How to give administrator or moderator permissions to users in rail3 through the console.
> The rails2 commands do not work :(

Oh I usually just use SQL for first admin.. You should be able to do it 
with this though:

user.roles.create({:role => "administrator", :granter_id => 3}, 
:without_protection => true)

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/



More information about the rails-dev mailing list