<commit_before># encoding: utf-8

def authorize!(*roles)
	return if @user and @user.authorize(roles)

	flash[:error] = t.flash.access_denied
	session[:login_redirect] = request.url
	redirect '/login'
end

def authorize_basic!(*roles)
	return if @user and @user.authorize(roles)

	auth ||= Rack::Auth::Basic::Request.new(request.env)
	if auth.provided? and auth.basic? and auth.credentials
		if @user = User.first(:username => auth.username)
			if @user.password == auth.credentials[1] and @user.authorize(roles)
				return
			end
		end<commit_msg>Remore flash error on access denied<commit_after># encoding: utf-8

def authorize!(*roles)
	return if @user and @user.authorize(roles)

	session[:login_redirect] = request.url
	redirect '/login'
end

def authorize_basic!(*roles)
	return if @user and @user.authorize(roles)

	auth ||= Rack::Auth::Basic::Request.new(request.env)
	if auth.provided? and auth.basic? and auth.credentials
		if @user = User.first(:username => auth.username)
			if @user.password == auth.credentials[1] and @user.authorize(roles)
				return
			end
		end
{'fraction_non_alphanumeric': 0.13556174558960074, 'fraction_numerical': 0.003714020427112349, 'mean_word_length': 4.923076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4406067', 'n_tokens_mistral': 396, 'n_tokens_neox': 367, 'n_words': 90}