This function allows you to get the belonging relation between a privilege subject subject_name and a privilege subject container_name.
If the state parameter equals FALSE or NULL, the function will check whether the first subject is directly belonging to the other. If state equals TRUE, the function will check whether the first subject belongs to the second directly or indirectly (through another privilege subject). You may check the indirect membership of a user in a role through some usergroup in this way.
If the second subject is a role, you may prefix its container_name name with the name of the scheme it belongs to.
NULL if an error occurs. Otherwise returns TRUE, if the first subject is a member of the second, or false otherwise.
Find out whether the used David is a member of the Accountant role:
SET IsMember = Get_membership('David', CATEG_USER, 'Accountant', CATEG_ROLE, TRUE);