def test_querystring_resource_map(polar, load_policy, query): assert query( Predicate( name="allow", args=[ Actor(name="sam"), "what", Http(path="/widget/12", query={"param": "foo"}), ], )) assert not query( Predicate(name="allow", args=[Actor(name="sam"), "what", Http(path="/widget/12")]))
def create_widget(): if not query( Predicate( name="allow", args=[g.user, request.method.lower(), Http(path=request.path)], ) ): return Response("Denied", status=403) return Response("Ok", status=204)