You have imported the required interfaces and gotten the required factories.
More information: User Management Functions for Roles .
This procedure describes how to edit a role attribute programmatically. Use this procedure if you cannot use the existing user administration tools to perform role modification and need to customize your tools to edit roles programmatically.
This example gets the unique ID of the role "demo_role" . The class then gets the role and changes the value of the attribute "myAttributeName" in the namespace "com.example" to "myValue" .
public static void modifyRole_additionalAttribute(String roleUniqueName, String nameSpace, String attributeName, String myValue) { try { // Get the role. // Get the unique ID. // Check if the attribute is read-only or read-write. // Get a modifiable role object from the UME. /* * Set the attribute value. * * Note: The attribute value must not exceed 255 characters. * The value of unique name must not exceed 200 characters. */ // Write the changes to the database. } else { // TODO: Handle attribute is not modifiable. } } catch (NoSuchRoleException nsrex) { // TODO: Handle NoSuchRoleException. } catch (UMException umex) { // TODO: Handle UMException. } catch (UMRuntimeException umrex) { // TODO: Handle UMRuntimeException. } }