2013-01-17 17:35:57 +02:00
|
|
|
module Projects
|
|
|
|
class UpdateContext < BaseContext
|
|
|
|
def execute(role = :default)
|
2013-03-25 10:48:30 +02:00
|
|
|
params[:project].delete(:namespace_id)
|
2013-01-17 17:35:57 +02:00
|
|
|
params[:project].delete(:public) unless can?(current_user, :change_public_mode, project)
|
|
|
|
project.update_attributes(params[:project], as: role)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|