Show More
Commit Description:
- fix authorization for viewing submission, only admin can view all problems all the time, normal user depends on right.view_submission and problem.available?...
Commit Description:
- fix authorization for viewing submission, only admin can view all problems all the time, normal user depends on right.view_submission and problem.available? - add max score query
References:
File last commit:
Show/Diff file:
Action:
app/controllers/configurations_controller.rb | 29 lines | 832 B | text/x-ruby | RubyLexer |
class ConfigurationsController < ApplicationController
before_filter :authenticate
before_filter { |controller| controller.authorization_by_roles(['admin'])}
def index
@configurations = GraderConfiguration.find(:all,
:order => '`key`')
end
def reload
GraderConfiguration.reload
redirect_to :action => 'index'
end
def update
@config = GraderConfiguration.find(params[:id])
User.clear_last_login if @config.key == GraderConfiguration::MULTIPLE_IP_LOGIN_KEY and @config.value == 'true' and params[:grader_configuration][:value] == 'false'
respond_to do |format|
if @config.update_attributes(params[:grader_configuration])
format.json { head :ok }
else
format.json { respond_with_bip(@config) }
end
end
end
end