gitlab-org--gitlab-foss/app/serializers/request_aware_entity.rb

16 lines
262 B
Ruby
Raw Normal View History

2016-10-28 08:32:07 -04:00
module RequestAwareEntity
extend ActiveSupport::Concern
included do
include Gitlab::Routing.url_helpers
end
def request
@options.fetch(:request)
2016-10-28 08:32:07 -04:00
end
def can?(object, action, subject)
Ability.allowed?(object, action, subject)
end
2016-10-28 08:32:07 -04:00
end