public class SecurityManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SecurityManager.BuiltInAction |
| Constructor and Description |
|---|
SecurityManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate() |
AgentProxy |
authenticate(String agentName,
String agentPassword,
String resource) |
AgentProxy |
authenticate(String agentName,
String agentPassword,
String resource,
boolean isClient) |
AgentProxy |
authenticate(String agentName,
String agentPassword,
String resource,
boolean isClient,
TransactionKey transactionKey) |
boolean |
checkPermissions(AgentPath agent,
Activity act,
ItemPath itemPath,
TransactionKey transactionKey) |
boolean |
checkPermissions(AgentPath agent,
SecurityManager.BuiltInAction builtInAction,
ItemPath itemPath,
TransactionKey transactionKey) |
static String |
decodePublicSecurityMessage(Throwable ex)
Reads the message from the exception that can be show to the user.
|
static String |
encodePublicSecurityMessage(String msg)
Wraps the massage with specific tokens indicating the the exception has a message to the user.
|
org.apache.shiro.subject.Subject |
getSubject(AgentPath agent) |
org.apache.shiro.subject.Subject |
getSubject(String principal) |
void |
setupShiro()
Loads shiro.ini file from a file or from the classpath (default)
TODO: replace the use of IniSecurityManagerFactory with shiro Environment initialization
|
boolean |
shiroAuthenticate(String agentName,
String agentPassword) |
public SecurityManager()
throws InvalidDataException
InvalidDataExceptionpublic void authenticate()
throws InvalidDataException,
ObjectNotFoundException
public AgentProxy authenticate(String agentName, String agentPassword, String resource) throws InvalidDataException, ObjectNotFoundException
public AgentProxy authenticate(String agentName, String agentPassword, String resource, boolean isClient) throws InvalidDataException, ObjectNotFoundException
agentName - agentPassword - resource - isClient - InvalidDataExceptionObjectNotFoundExceptionpublic AgentProxy authenticate(String agentName, String agentPassword, String resource, boolean isClient, TransactionKey transactionKey) throws InvalidDataException, ObjectNotFoundException
agentName - agentPassword - resource - isClient - ItemProxy should only be used in the client processesInvalidDataExceptionObjectNotFoundExceptionpublic org.apache.shiro.subject.Subject getSubject(AgentPath agent)
agent - public org.apache.shiro.subject.Subject getSubject(String principal)
principal - public void setupShiro()
public static String decodePublicSecurityMessage(Throwable ex)
ex - the exception to be processedpublic static String encodePublicSecurityMessage(String msg)
msg - the message to be wrappedpublic boolean shiroAuthenticate(String agentName, String agentPassword) throws InvalidDataException
agentName - agentPassword - InvalidDataExceptionpublic boolean checkPermissions(AgentPath agent, Activity act, ItemPath itemPath, TransactionKey transactionKey) throws AccessRightsException, ObjectNotFoundException
agent - stepPath - itemPath - AccessRightsExceptionObjectNotFoundException - Item was not foundpublic boolean checkPermissions(AgentPath agent, SecurityManager.BuiltInAction builtInAction, ItemPath itemPath, TransactionKey transactionKey) throws AccessRightsException, ObjectNotFoundException
agent - stepPath - itemPath - AccessRightsExceptionObjectNotFoundException - Item was not foundCopyright © 1997–2022 CRISTAL-iSE. All rights reserved.