summaryrefslogtreecommitdiff
path: root/app/serializers/request_aware_entity.rb
blob: e159d750cb7e3dd7bb42189768dc0edec298c1f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module RequestAwareEntity
  extend ActiveSupport::Concern

  included do
    include Gitlab::Routing.url_helpers
  end

  def request
    @options.fetch(:request)
  end

  def can?(object, action, subject)
    Ability.allowed?(object, action, subject)
  end
end