Package org.cristalise.kernel.security
Class SecurityManager
java.lang.Object
org.cristalise.kernel.security.SecurityManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(String agentName, String agentPassword, String resource) authenticate(String agentName, String agentPassword, String resource, boolean isClient) authenticate(String agentName, String agentPassword, String resource, boolean isClient, TransactionKey transactionKey) booleancheckPermissions(AgentPath agent, Activity act, ItemPath itemPath, TransactionKey transactionKey) static StringReads the message from the exception that can be show to the user.static StringWraps the massage with specific tokens indicating the the exception has a message to the user.org.apache.shiro.subject.SubjectgetSubject(String principal) org.apache.shiro.subject.SubjectgetSubject(AgentPath agent)
-
Constructor Details
-
SecurityManager
- Throws:
InvalidDataException
-
-
Method Details
-
authenticate
-
authenticate
public AgentProxy authenticate(String agentName, String agentPassword, String resource) throws InvalidDataException, ObjectNotFoundException -
authenticate
public AgentProxy authenticate(String agentName, String agentPassword, String resource, boolean isClient) throws InvalidDataException, ObjectNotFoundException - Parameters:
agentName-agentPassword-resource-isClient-- Returns:
- Throws:
InvalidDataExceptionObjectNotFoundException
-
authenticate
public AgentProxy authenticate(String agentName, String agentPassword, String resource, boolean isClient, TransactionKey transactionKey) throws InvalidDataException, ObjectNotFoundException - Parameters:
agentName-agentPassword-resource-isClient- ItemProxy should only be used in the client processes- Returns:
- AgentProxy of the user or returns null isClient is true
- Throws:
InvalidDataExceptionObjectNotFoundException
-
getSubject
- Parameters:
agent-- Returns:
-
getSubject
- Parameters:
principal-- Returns:
-
decodePublicSecurityMessage
Reads the message from the exception that can be show to the user.- Parameters:
ex- the exception to be processed- Returns:
- returns the message or null if nothing was found
-
encodePublicSecurityMessage
Wraps the massage with specific tokens indicating the the exception has a message to the user.- Parameters:
msg- the message to be wrapped- Returns:
- the wrapped message
-
checkPermissions
public boolean checkPermissions(AgentPath agent, Activity act, ItemPath itemPath, TransactionKey transactionKey) throws AccessRightsException, ObjectNotFoundException - Parameters:
agent-act-itemPath-transactionKey-- Returns:
- Throws:
AccessRightsExceptionObjectNotFoundException
-