z_controller_helper (zotonic_core v1.0.0-rc.14)
Link to this section Summary
Functions
Decode the request data
Decode the request data - remove zotonic arguments that are part of the query string and/or post.
Encode the response data
Fetch the id from the dispatch configuration.
Fetch the id from the request or the dispatch configuration.
Check if the current user is allowed to access the controller.
Link to this section Functions
Link to this function
decode_request(CT, Context)
-spec decode_request(undefined | cow_http_hd:media_type(), z:context()) -> {map() | binary(), z:context()}.
Link to this function
decode_request_noz(Mime, Context)
-spec decode_request_noz(undefined | cow_http_hd:media_type(), z:context()) -> {map() | binary(), z:context()}.
Link to this function
encode_response(Mime, Data)
-spec encode_response(Mime :: cow_http_hd:media_type(), term()) -> binary().
Link to this function
get_configured_id(Context)
-spec get_configured_id(z:context()) -> m_rsc:resource_id() | undefined.
Link to this function
get_id(Context)
-spec get_id(z:context()) -> m_rsc:resource_id() | undefined.
Link to this function
is_authorized(OptRscId, Context)
Link to this function
is_authorized(OptRscId, ACL, Context)
-spec is_authorized(OptRscId, ACL, z:context()) -> {boolean(), z:context()} when OptRscId :: m_rsc:resource_id() | undefined, ACL :: boolean() | z_acl:acl().
Link to this function
is_authorized_action(Action, Object, Context)
-spec is_authorized_action(z_acl:action(), z_acl:object(), z:context()) -> {boolean(), z:context()}.
Link to this function