class Gollum::Auth::Request

Constants

WRITE_PATH_RE

Public Instance Methods

requires_authentication?(allow_unauthenticated_readonly) click to toggle source
# File lib/gollum/auth/request.rb, line 9
def requires_authentication?(allow_unauthenticated_readonly)
  !allow_unauthenticated_readonly || is_write_path?
end
store_author_in_session(user) click to toggle source
# File lib/gollum/auth/request.rb, line 13
def store_author_in_session(user)
  session['gollum.author'] = { name: user.name, email: user.email }
end

Private Instance Methods

is_write_path?() click to toggle source

Returns true if path is a write path that would change the wiki.

# File lib/gollum/auth/request.rb, line 20
def is_write_path?
  !!(path_info =~ WRITE_PATH_RE)
end