debian-mirror-gitlab/app/services/protected_branches/update_service.rb

14 lines
352 B
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
module ProtectedBranches
class UpdateService < BaseService
attr_reader :protected_branch
def execute(protected_branch)
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_project, project)
@protected_branch = protected_branch
@protected_branch.update(params)
@protected_branch
end
end
end