Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up admin automatically #49

Closed
meling opened this issue Aug 1, 2017 · 5 comments
Closed

Set up admin automatically #49

meling opened this issue Aug 1, 2017 · 5 comments

Comments

@meling
Copy link
Contributor

meling commented Aug 1, 2017

I always forget to run the agctl command to set up the admin user. I would like to make that happen automatically when starting the server for the first time with an empty database. Are there any concerns with doing this s111?

@s111
Copy link
Contributor

s111 commented Aug 1, 2017

I think using agctl or just flipping the bool using sqlite3 is the best option. We could have the first user to register always be an admin. The only concern I have is the added complexity.

@meling
Copy link
Contributor Author

meling commented Aug 2, 2017

All teachers will be admin in the sense that they can create courses etc. The first user to be admin will be responsible for promoting other teachers (at least the first other teacher) to admin role. So User.ID=1 has no special meaning except always being admin. So in CreateUserFromRemoteIdentity we can simply set IsAdmin:=true for the first user. This does not add much complexity IMO. Am I missing something @s111?

@s111
Copy link
Contributor

s111 commented Aug 2, 2017

No I don't think so, that's why I suggested having the first user always be an admin, as it's the least intrusive change.

@meling
Copy link
Contributor Author

meling commented Aug 2, 2017

@s111 please review my commit 6caf767 ; can we close this issue?

@s111
Copy link
Contributor

s111 commented Aug 2, 2017

LGTM

@s111 s111 closed this as completed Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants