ruby on rails - How to make someone admin after deploying? -


i haven't deployed app yet , far it. implementing admin interface in app now. here question i'd ask before implement it.

i going add admin column, boolean default value: false users table. admin not going included in attr_accessible. in development, can change value of admin issuing: user.toggle!(:admin) in console.

how once have deployed app?

if understood correctly

if want role based authorization there many gems available adding roles users

https://github.com/be9/acl9

https://github.com/ryanb/cancan/wiki/role-based-authorization

rails 3: devise add roles checkboxes registration form

how make admin after deploying?

using database seed can create/set admin

for more info: http://guides.rubyonrails.org/command_line.html#rake

update:

admin_user = user.create!(       :login => 'admin_username',       :email => 'admin@app.com',       :password => 'secret',       :password_confirmation => 'secret',       :is_admin => true      )  #change column names yours 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -