def has_permission_for_route(request, route_name, permission, res_id):
    introspector = request.registry.introspector
route_name = request.matched_route.name
route_intr = introspector.get('routes', route_name)
factory = route_intr['factory']
resource = factory(request, res_id=res_id)
return has_permission(permission, resource, request)
Pyramid: Check for permission given a route name