-
Notifications
You must be signed in to change notification settings - Fork 78
Making Admin Users in Sufia
E. Lynette Rayle edited this page Aug 25, 2016
·
7 revisions
Follow the directions for installing hydra-role-management.
NOTE: When adding cancan abilities, put them at the end of the custom_permissions method.
Run rails console
$ rails c
Run the following commands in the rails console
u = User.find_by_user_key( "your_admin_users_email@fake.email.org" )
r = Role.create name: "admin"
r.users << u
r.save
Run the following commands in the rails console
u = User.find_by_user_key( "your_admin_users_email@fake.email.org" )
r = Role.find_by_name("admin")
r.users << u
r.save
- Login as an admin user
- add /roles to the end of the main URL
- select a role and add user
Run the following commands in the rails console
u = User.find_by_user_key( "your_admin_users_email@fake.email.org" )
u.admin?
# shows SELECT statment
=> true
if u.admin? == true then SUCCESS
- go to your Sufia install
- login as the admin user
- add /roles to the end of the main URL
SUCCESS will look like...
- you don't get an error on the /roles page
- you see a button labeled "Create a new role"
If you don't see this or get a permission error, you may need to restart and try again in the browser.