gitlabhq/app/contexts/projects/update_context.rb
2013-03-25 10:48:30 +02:00

10 lines
303 B
Ruby

module Projects
class UpdateContext < BaseContext
def execute(role = :default)
params[:project].delete(:namespace_id)
params[:project].delete(:public) unless can?(current_user, :change_public_mode, project)
project.update_attributes(params[:project], as: role)
end
end
end