2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-08-05 18:40:47 +02:00
|
|
|
class APIEntreprise::PrivilegesAdapter < APIEntreprise::Adapter
|
2020-10-19 11:33:36 +02:00
|
|
|
def initialize(token)
|
|
|
|
@token = token
|
|
|
|
end
|
|
|
|
|
|
|
|
def valid?
|
|
|
|
begin
|
|
|
|
get_resource
|
|
|
|
true
|
|
|
|
rescue
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def get_resource
|
2022-07-20 14:52:17 +02:00
|
|
|
api.tap do
|
|
|
|
_1.token = @token
|
|
|
|
end.privileges
|
2020-10-19 11:33:36 +02:00
|
|
|
end
|
|
|
|
end
|