com.ibm.di.api.security
Class Role

java.lang.Object
  extended by com.ibm.di.api.security.Role

public class Role
extends java.lang.Object

This class defines a specific role assigned to a user.


Field Summary
protected static java.lang.String ALLIST
          A String constant for the ALs.
static int ROLE_ADMIN
          The Id of the admin privileges.
static int ROLE_EXECUTE
          The Id of the execute privileges.
static java.lang.String[] ROLE_NAMES
          The string representation of the available privileges.
static int ROLE_READ
          The Id of the read privileges.
 
Constructor Summary
Role()
          Constructs a role
Role(java.lang.String aRole, java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,java.util.Vector<java.lang.String>>> aMap)
          Constructs a role
 
Method Summary
 boolean canExecuteAL(java.lang.String aConfigId, java.lang.String aAssemblyLine)
          Check that the specific AssemblyLine could be started by the user.
 boolean canExecuteAll()
          Returns whether specified user is allowed to execute everything.
 boolean canExecuteConfig(java.lang.String aConfigId)
          Returns whether specified user is allowed to execute given configuration.
 boolean canExecuteConfigALs(java.lang.String aConfigId)
          Returns whether specified user is allowed to execute assembly lines from a given configuration.
 boolean canReadAll()
          Returns whether specified user is allowed to read everything.
 boolean canReadConfig(java.lang.String aConfigId)
          Check that the specific configuration could be read by the user.
 int getRole()
          Retrives the ID of the given privileges level .
 java.lang.String getRoleName()
          Retrieves the name of the role.
 boolean isAdmin()
          Verify if role is admin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLIST

protected static final java.lang.String ALLIST
A String constant for the ALs.

See Also:
Constant Field Values

ROLE_ADMIN

public static final int ROLE_ADMIN
The Id of the admin privileges.

See Also:
Constant Field Values

ROLE_READ

public static final int ROLE_READ
The Id of the read privileges.

See Also:
Constant Field Values

ROLE_EXECUTE

public static final int ROLE_EXECUTE
The Id of the execute privileges.

See Also:
Constant Field Values

ROLE_NAMES

public static final java.lang.String[] ROLE_NAMES
The string representation of the available privileges.

Constructor Detail

Role

public Role()
Constructs a role


Role

public Role(java.lang.String aRole,
            java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,java.util.Vector<java.lang.String>>> aMap)
     throws DIException
Constructs a role

Parameters:
aRole - the role name
aMap - the objects this role applies on.
Throws:
DIException - if the aRole parameter is either null or an unsupportable role.
Method Detail

getRole

public int getRole()
Retrives the ID of the given privileges level .

Returns:
the role id.
See Also:
ROLE_ADMIN, ROLE_READ, ROLE_EXECUTE

getRoleName

public java.lang.String getRoleName()
Retrieves the name of the role.

Returns:
the string representation of the role, or null if the inner role id is invalid.

isAdmin

public boolean isAdmin()
Verify if role is admin.

Returns:
true if the inner role id is ROLE_ADMIN

canReadConfig

public boolean canReadConfig(java.lang.String aConfigId)
Check that the specific configuration could be read by the user.

Parameters:
aConfigId - the configInstance identifier
Returns:
true if the user have been given this privilege.

canExecuteAL

public boolean canExecuteAL(java.lang.String aConfigId,
                            java.lang.String aAssemblyLine)
Check that the specific AssemblyLine could be started by the user.

Parameters:
aConfigId - the configInstance that has this AL
aAssemblyLine - the name of the AL to check for
Returns:
true if the user have been given this privilege.

canExecuteConfigALs

public boolean canExecuteConfigALs(java.lang.String aConfigId)
Returns whether specified user is allowed to execute assembly lines from a given configuration.

Parameters:
aConfigId - the configInstance identifier
Returns:
true if the user have been given this privilege.

canExecuteConfig

public boolean canExecuteConfig(java.lang.String aConfigId)
Returns whether specified user is allowed to execute given configuration.

Parameters:
aConfigId - the configInstance identifier
Returns:
true if the user have been given this privilege.

canExecuteAll

public boolean canExecuteAll()
Returns whether specified user is allowed to execute everything.

Returns:
true if the user have been given this privilege.

canReadAll

public boolean canReadAll()
Returns whether specified user is allowed to read everything.

Returns:
true if the user have been given this privilege.