2016-01-25 15:54:21 +01:00
|
|
|
class UserRoutesAuthorizationService
|
2018-03-20 17:47:37 +01:00
|
|
|
def self.authorized_route?(controller, dossier)
|
2016-01-26 15:52:05 +01:00
|
|
|
auth = controller.route_authorization
|
2016-01-25 15:54:21 +01:00
|
|
|
|
2018-08-28 14:12:48 +02:00
|
|
|
auth[:states].include?(dossier.state) &&
|
2018-10-31 11:32:41 +01:00
|
|
|
(auth[:api_carto].nil? ? true : auth[:api_carto] == dossier.use_legacy_carto?)
|
2016-01-25 15:54:21 +01:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|