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