4.29 - Add Dynamic Separation of Duty (DSD) Set Member
SDSet addDsdRoleMember( SDSet ssdSet, Role role ) throws SecurityException;
This command adds a role to a named DSD set of roles. The cardinality associated with the role set remains unchanged.
The command is valid if and only if:
- The DSD role set exists.
- The role to be added is a member of the ROLES data set but not of a member of the DSD role set.
- The DSD constraint for the new role set is satisfied.
This method:
- Adds a member to an existing DSD set.
- Affects (runtime) role activations.
required parameters:
- SDSet#name - contains the name for the Set to be modified.
- Type of SD Set - ‘DYNAMIC’ (automatically set via this method).
- Role#name - of new set member.
Throws:
- SecurityException - thrown in the event of data validation or system error.
addDsdRoleMember
import org.apache.directory.fortress.core.AdminMgr;
import org.apache.directory.fortress.core.AdminMgrFactory;
import org.apache.directory.fortress.core.model.SDSet;
import org.apache.directory.fortress.core.model.Role;
import org.apache.directory.fortress.core.SecurityException;
@test
public static void testAddDsdRoleMember()
{
String szLocation = ".testAddDsdRoleMember";
try
{
AdminMgr adminMgr = AdminMgrFactory.createInstance();
SDSet inDsdSet = new SDSet();
// existing set name:
inDsdSet.setName( "myDsdSetName" );
// existing role name:
Role inRole - new Role( "role1" );
SDSet outDsdSet = am.addDsdRoleMember( inDsdSet, inRole );
}
catch (SecurityException ex)
{
LOG.error(szLocation + " caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}