gobj_user_has_authz()

gobj_user_has_authz()#

Checks if a user has the specified authorization level in the context of the given hgobj. If no authorization checker is defined, the function defaults to granting authorization.

Prototype

BOOL gobj_user_has_authz(
    hgobj gobj,
    const char *authz,
    json_t *kw,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The hgobj instance in which the authorization check is performed.

authz

const char *

The name of the authorization level to check.

kw

json_t *

A JSON object containing additional parameters for the authorization check.

src

hgobj

The source hgobj requesting the authorization check.


Return Value

Returns TRUE if the user has the required authorization, otherwise returns FALSE.

Notes

If the hgobj has a local authorization checker (mt_authz_checker), it is used first. If not, the global authorization checker is used. If neither is defined, the function defaults to returning TRUE.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples