code: func (s *Service) CheckRequestPerm(r *http.Request, perm string) bool {
  	if s.credentialStore == nil {
  		return true
  	}
  
  	username, _, ok := r.BasicAuth()
  	if !ok {
  		return false
  	}
  	return s.credentialStore.HasAnyPerm(username, perm, PermAll)
  }
docs: // CheckRequestPerm returns true if authentication is enabled and the user contained
  // in the BasicAuth request has either PermAll, or the given perm.