Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Administration

cpapazian edited this page Oct 21, 2014 · 9 revisions

When developing for MyUSA, you may find it helpful to be an administrator. To enable a user as administrator, follow these steps:

  1. Open a rails console

bundle exec rails console

  1. Find your user account

User.all

  1. Make the user an admin

User.find(1).has_role!(:admin)

Questions:

  1. How do you un-make someone an admin?

User.find_by_email('joe@polastre.com').has_no_role!(:owner, resource)

  1. What does this change to in the next rev of roles?

User#has_role!(...) changes to User#grant_role!(...) and User#has_no_role!(...) changes to User#revoke_role!(...)

Clone this wiki locally