Set_membership

SQL

function Set_membership(IN subject_name CHAR(31), IN subject_categ INT, IN container_name CHAR(31), IN container_categ INT, IN state BOOLEAN); returns BOOLEAN;


Parametry

subject_name
privilege subject name (user, usergroup)
subject_categ
privilege subject subject_name category
container_name
privilege subject name (usergroup, role)
container_categ
privilege subject container_name category
state
state of membership


Od verze

7.0c

Popis

This function allows you to get or modify the state of membership between privilege subject subject_name and the privilege subject container_name.

If the state parameter equals TRUE, the function will insert the first object into the second. If the state equals FALSE, the function will remove the first subject from the second. If the state equals NULL, the function will find out if the first subject belongs to the second.

If the second subject is a role, you may prefix the container_name with the name of the scheme the role belongs to.



Návratová hodnota

Returns NULL if an error occurs. If the state equals TRUE or FALSE, this function returns TRUE if successful. If the state parameter equals NULL, the function returns TRUE, if the first subject is a member of the second, FALSE otherwise.



Příklad

Insert the David user into the Accountants group:

CALL Set_membership('David', CATEG_USER, 'Accountants', CATEG_GROUP, TRUE);

Viz