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
|
2020-08-05 18:40:47 +02:00
|
|
|
APIEntreprise::API.privileges(@token)
|
2020-10-19 11:33:36 +02:00
|
|
|
end
|
|
|
|
end
|