Add comment to AuthorizedUser

pull/10616/head
Michael Desa 2017-10-18 12:45:58 -04:00
parent 3430eeb84b
commit 0517a87954
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func AuthorizedToken(auth oauth2.Authenticator, logger chronograf.Logger, next h
})
}
// AuthorizedUser extracts the user name and provider from context. If the user and provider can be found on the
// context, we look up the user by their name and provider. If the user is found, we verify that the user has at
// at least the role supplied.
func AuthorizedUser(store chronograf.UsersStore, useAuth bool, role string, logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if !useAuth {