Merge pull request #61 from gopesht/fix_first_admin_setup
Fix admin first setup, email and password in README
This commit is contained in:
commit
5ed51c7499
2 changed files with 8 additions and 8 deletions
10
README.md
10
README.md
|
|
@ -77,13 +77,9 @@ bundle exec rake db:seed
|
||||||
|
|
||||||
7. Connect to osem.example.org and register your first user. Make also sure that Postfix is installed and configured on the system for the confirmation mail to pass through.
|
7. Connect to osem.example.org and register your first user. Make also sure that Postfix is installed and configured on the system for the confirmation mail to pass through.
|
||||||
|
|
||||||
8. To make the first registered user an admin:
|
8. Just sign up as a new user and you will be automatically assigned as admin role.
|
||||||
```
|
|
||||||
rails console
|
|
||||||
User.all
|
|
||||||
me = User.find('1')
|
|
||||||
me.role_ids=[3]
|
|
||||||
```
|
|
||||||
|
|
||||||
Caveats
|
Caveats
|
||||||
=======
|
=======
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,10 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_role
|
def setup_role
|
||||||
|
if self.id == 1
|
||||||
|
self.role_ids = [3]
|
||||||
|
end
|
||||||
|
|
||||||
if self.role_ids.empty?
|
if self.role_ids.empty?
|
||||||
self.role_ids = [1]
|
self.role_ids = [1]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue