This API adds or updates the allowed roles for a Guardium user.

Note: Running set_user_roles clears all of the current roles for the specified user. Include any existing roles that you want to keep for that user.

This API is available in Guardium V9.5 and later.

REST API syntax

This API is available as a REST service with the PUT method. Call this API as follows:
PUT https://[Guardium hostname or IP address]:8443/restAPI/user_roles

GuardAPI syntax

set_user_roles parameter=value


Parameter Value type Description
roles String Required. The role or roles to assign to this user. To add more than one role, use a comma to separate the roles (but no spaces).
userName String Required. The name of the user to whom to assign or update roles.


Set the roles for the user named FredMcDerf (who was created with the create_user API).

grdapi set_user_roles userName="Fred McDerf" roles="admin,dba,diag,cli"

Sample output:

Added role (admin).
Added role (dba).
Added role (diag).
Added role (cli).