'Check policy rules.
Check the group of policy rules supplied in the POST
application/json object. The policy target, if specified will also be
passed in to the policy check method as well.
The action returns an object with one key: "allowed" and the value
is the result of the policy check, True or False.'

@rest_utils.ajax(data_required=True)
def post(self, request):

    rules = []
    try:
        rules_in = request.DATA['rules']
        rules = tuple([tuple(rule) for rule in rules_in])
    except Exception:
        raise rest_utils.AjaxError(400, 'unexpected    parameter    format')
    policy_target = (request.DATA.get('target') or {})
    result = policy.check(rules, request, policy_target)
    return {'allowed': result}
