demarches-normaliennes/app/services/user_routes_authorization_service.rb
2018-11-20 10:53:14 +01:00

8 lines
272 B
Ruby

class UserRoutesAuthorizationService
def self.authorized_route?(controller, dossier)
auth = controller.route_authorization
auth[:states].include?(dossier.state) &&
(auth[:api_carto].nil? ? true : auth[:api_carto] == dossier.use_legacy_carto?)
end
end