Permalink
Browse files

First user created has admin privileges.

  • Loading branch information...
1 parent 246fabc commit 12b5f5832848c7ad1de56060350cb03ff1da6008 @antirez committed Oct 10, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 app.rb
View
3 app.rb
@@ -1015,6 +1015,9 @@ def create_user(username,password)
"karma_incr_time",Time.new.to_i)
$r.set("username.to.id:#{username.downcase}",id)
$r.set("auth:#{auth_token}",id)
+
+ # First user ever created (id = 1) is an admin
+ $r.hmset("user:#{id}","flags","a") if id.to_i == 1
return auth_token,nil
end

0 comments on commit 12b5f58

Please sign in to comment.