SQLBOX_ROLE_HIER_STMT(3)

NAME
sqlbox_role_hier_stmt - add a permission to a role

LIBRARY
sqlbox

SYNOPSIS
#include <stdint.h>
#include <sqlbox.h>
int
sqlbox_role_hier_src(struct sqlbox_role_hier *p, size_t role, size_t src);
int
sqlbox_role_hier_stmt(struct sqlbox_role_hier *p, size_t role, size_t stmt);

DESCRIPTION
Add permissions (statements or sources) to a role. Adding a duplicate permission is a noop. Adding the same permission as claimed by an ancestor is effectively a noop as well. These permissions will be inherited by any children (see sqlbox_role_hier_child(3)) when the roles are generated with sqlbox_role_hier_gen(3).

RETURN VALUES
Returns zero if role exceeds the number of roles specified in sqlbox_role_hier_alloc(3) or if memory allocation fails. Returns non-zero otherwise.

SEE ALSO
sqlbox_role_hier_child(3), sqlbox_role_hier_gen(3)