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
|