debian-mirror-gitlab/app/services/achievements/base_service.rb

21 lines
464 B
Ruby
Raw Normal View History

2023-03-17 16:20:25 +05:30
# 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