demarches-normaliennes/app/services/user_routes_authorization_service.rb
2016-01-26 15:52:05 +01:00

9 lines
No EOL
284 B
Ruby

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