demarches-normaliennes/app/services/user_routes_authorization_service.rb

9 lines
285 B
Ruby
Raw Normal View History

class UserRoutesAuthorizationService
def self.authorized_route?(controller, dossier)
2016-01-26 15:52:05 +01:00
auth = controller.route_authorization
2016-01-26 15:52:05 +01:00
auth[:states].include?(dossier.state.to_sym) &&
(auth[:api_carto].nil? ? true : auth[:api_carto] == dossier.procedure.use_api_carto)
end
2017-04-04 15:27:04 +02:00
end