Reuse `Gitlab::Allowable` mixin in base service
This commit is contained in:
parent
c0db4400f4
commit
3063ab45dd
|
@ -1,4 +1,5 @@
|
||||||
class BaseService
|
class BaseService
|
||||||
|
include Gitlab::Allowable
|
||||||
include Gitlab::CurrentSettings
|
include Gitlab::CurrentSettings
|
||||||
|
|
||||||
attr_accessor :project, :current_user, :params
|
attr_accessor :project, :current_user, :params
|
||||||
|
@ -7,10 +8,6 @@ class BaseService
|
||||||
@project, @current_user, @params = project, user, params.dup
|
@project, @current_user, @params = project, user, params.dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def can?(object, action, subject)
|
|
||||||
Ability.allowed?(object, action, subject)
|
|
||||||
end
|
|
||||||
|
|
||||||
def notification_service
|
def notification_service
|
||||||
NotificationService.new
|
NotificationService.new
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue