gitlab-org--gitlab-foss/app/services/base_service.rb

36 lines
700 B
Ruby
Raw Normal View History

class BaseService
attr_accessor :project, :current_user, :params
def initialize(project, user, params)
@project, @current_user, @params = project, user, params.dup
end
2012-07-27 20:35:24 -04:00
def abilities
@abilities ||= begin
abilities = Six.new
abilities << Ability
abilities
end
end
def can?(object, action, subject)
abilities.allowed?(object, action, subject)
end
def notification_service
NotificationService.new
end
def event_service
EventCreateService.new
end
def log_info message
Gitlab::AppLogger.info message
end
2014-06-17 15:20:10 -04:00
def system_hook_service
SystemHooksService.new
end
end