Refactor administrators a bit

Only a matter of time before some other sucker gets the privilege
This commit is contained in:
R. Tyler Croy 2018-01-02 15:06:43 -08:00
parent dbe240ac4b
commit c6bffa354d
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,8 @@ module CodeValet
class App < Sinatra::Base
include Warden::GitHub::SSO
ADMINISTRATORS = %w(rtyler).freeze
enable :sessions
set :session_secret, ENV.fetch('SESSION_SECRET') { SecureRandom.hex(64) }
@ -64,7 +66,7 @@ module CodeValet
def admin?
return false unless env['warden'].user
return env['warden'].user.login == 'rtyler'
return ADMINISTRATORS.include? env['warden'].user.login
end
end