Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base_service.rb « achievements « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a8e6ee3c78efb9fedb695bd8e25e8f44f60403e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module Achievements
  class BaseService < ::BaseContainerService
    def initialize(namespace:, current_user: nil, params: {})
      @namespace = namespace
      super(container: namespace, current_user: current_user, params: params)
    end

    private

    def allowed?
      current_user&.can?(:admin_achievement, @namespace)
    end

    def error(message)
      ServiceResponse.error(message: Array(message))
    end
  end
end