magpie.api.requests¶
Module Contents¶
-
magpie.api.requests.get_multiformat_any(request, key, default=None) → Any[source]¶ Obtains the
keyelement from the request body using found Content-Type header.
-
magpie.api.requests.get_permission_multiformat_post_checked(request, service_or_resource, permission_name_key='permission_name') → Permission[source]¶ Retrieves the permission from the body and validates that it is allowed for the specified service or resource.
-
magpie.api.requests.get_user_matchdict_checked_or_logged(request, user_name_key='user_name')[source]¶
-
magpie.api.requests.get_resource_matchdict_checked(request, resource_name_key='resource_id') → models.Resource[source]¶
-
magpie.api.requests.get_service_matchdict_checked(request, service_name_key='service_name')[source]¶
-
magpie.api.requests.get_permission_matchdict_checked(request, service_or_resource, permission_name_key='permission_name') → Permission[source]¶ Obtains the permission specified in the
requestpath and validates that it is allowed for the specifiedservice_or_resourcewhich can be a service or a children resource.Allowed permissions correspond to the direct service permissions or restrained permissions of the resource under its root service.
Returns: found permission name if valid for the service/resource