Get_membership

SQL

function Get_membership(IN subject_name CHAR(31), IN subject_categ INT, IN container_name CHAR(31), IN container_categ INT, IN transitive BOOLEAN); returns BOOLEAN;


Parametry

subject_name
name of a privilege subject (user, usergroup)
subject_categ
category of the privilege subject subject_name
container_name
name of the privilege subject (usergroup, role)
container_categ
category of the privilege subject container_name
transitive
a flag allowing undirect belonging


Od verze

7.0f

Popis

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.



Návratová hodnota

NULL if an error occurs. Otherwise returns TRUE, if the first subject is a member of the second, or false otherwise.



Příklad

Find out whether the used David is a member of the Accountant role:

SET IsMember = Get_membership('David', CATEG_USER, 'Accountant', CATEG_ROLE, TRUE);

Viz