debian-mirror-gitlab/app/services/protected_branches/update_service.rb
2016-09-13 17:45:13 +05:30

13 lines
352 B
Ruby

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