Package com.ibm.di.api.security
Class Role
- java.lang.Object
-
- com.ibm.di.api.security.Role
-
public class Role extends java.lang.ObjectThis class defines a specific role assigned to a user.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringALLISTA String constant for the ALs.static intROLE_ADMINThe Id of the admin privileges.static intROLE_EXECUTEThe Id of the execute privileges.static java.lang.String[]ROLE_NAMESThe string representation of the available privileges.static intROLE_READThe Id of the read privileges.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExecuteAL(java.lang.String aConfigId, java.lang.String aAssemblyLine)Check that the specific AssemblyLine could be started by the user.booleancanExecuteAll()Returns whether specified user is allowed to execute everything.booleancanExecuteConfig(java.lang.String aConfigId)Returns whether specified user is allowed to execute given configuration.booleancanExecuteConfigALs(java.lang.String aConfigId)Returns whether specified user is allowed to execute assembly lines from a given configuration.booleancanReadAll()Returns whether specified user is allowed to read everything.booleancanReadConfig(java.lang.String aConfigId)Check that the specific configuration could be read by the user.intgetRole()Retrives the ID of the given privileges level .java.lang.StringgetRoleName()Retrieves the name of the role.booleanisAdmin()Verify if role is admin.
-
-
-
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 DIExceptionConstructs a role- Parameters:
aRole- the role nameaMap- the objects this role applies on.- Throws:
DIException- if theaRoleparameter 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 ALaAssemblyLine- 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.
-
-