com.bea.ales.controls
Interface ALESControl


public interface ALESControl

ALESControl is a public control interface, encapsulates ALES SSM runtime APIs, and provides access to ALES SSM runtime security service in a consistent, straightforward manner. A developer can drag and drop methods from the ALEScontrol onto a WLP page flow or a WLI process in Workshop and use the data returned by a selected method (access decision, roles, etc.) to drive a downstream node in the page flow or process.

Author:
Copyright © 2004 BEA Systems, Inc. All Rights Reserved.

Method Summary
 java.util.Collection getRoles(java.lang.String resource, java.lang.String action, java.util.Map appContext)
          Gets all roles for current login user in reference to a resource, action, and application context.
 boolean hasRole(java.lang.String resource, java.lang.String action, java.util.Map appContext, java.lang.String role)
          Determines if current login user has a specific role in reference to a resource, action, and application context.
 boolean isAccessAllowed(java.lang.String resource, java.lang.String action, java.util.Map appContext)
          Determines if current login user is permitted to access a specific resource with a specific action.
 boolean isAccessAllowedWithGrantedresources(java.lang.String resource, java.lang.String action, java.util.Map appContext, java.util.Collection grantedresources)
          Determines if current login user is permitted to access a specific resource with a specific action and gets all permitted to access resources from this resource.
 boolean isAccessAllowedWithResponseAttribues(java.lang.String resource, java.lang.String action, java.util.Map appContext, java.util.Map responseAttr)
          Determines if current login user is permitted to access a specific resource with a specific action and gets response attributes returned by the authorization system.
 void recordEvent(java.lang.String message, java.util.Map appContext, AuditSeverity severity)
          Sends an audit message to the audit service system.
 

Method Detail

getRoles

java.util.Collection getRoles(java.lang.String resource,
                              java.lang.String action,
                              java.util.Map appContext)
                              throws ALESControlException
Gets all roles for current login user in reference to a resource, action, and application context.

Parameters:
resource - a String represents the resource, for example, a resource defined in ALES is "//app/policy/wls9ssm/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService", if want know current login user is permitted to perform a action on the resource, string passed as resource to this method should be "/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService"
action - a String represents the action to be performed on a resource, which should be a defined privilege name in ALES, for example, "execute"
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
Returns:
a Collection of Strings represents the roles associated for this identity.
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.

hasRole

boolean hasRole(java.lang.String resource,
                java.lang.String action,
                java.util.Map appContext,
                java.lang.String role)
                throws ALESControlException
Determines if current login user has a specific role in reference to a resource, action, and application context.

Parameters:
resource - a String represents the resource, for example, a resource defined in ALES is "//app/policy/wls9ssm/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService", if want know current login user is permitted to perform a action on the resource, string passed as resource to this method should be "/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService"
action - a String represents the action to be performed on a resourcee, which should be a defined privilege name in ALES, for example, "execute"
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
role - a String represents the role to see if the current login user has
Returns:
a Collection of Strings represent the roles associated for this identity.
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.

isAccessAllowed

boolean isAccessAllowed(java.lang.String resource,
                        java.lang.String action,
                        java.util.Map appContext)
                        throws ALESControlException
Determines if current login user is permitted to access a specific resource with a specific action. The application context is also taken into account for this decision.

Parameters:
resource - a String represents the resource, for example, a resource defined in ALES is "//app/policy/wls9ssm/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService", if want know current login user is permitted to perform a action on the resource, string passed as resource to this method should be "/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService"
action - a String represents the action to be performed on the resource, which should be a defined privilege name in ALES, for example, "execute"
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
Returns:
true if the current login user has permission to do the action on the resource, false otherwise.
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.

isAccessAllowedWithGrantedresources

boolean isAccessAllowedWithGrantedresources(java.lang.String resource,
                                            java.lang.String action,
                                            java.util.Map appContext,
                                            java.util.Collection grantedresources)
                                            throws ALESControlException
Determines if current login user is permitted to access a specific resource with a specific action and gets all permitted to access resources from this resource. The application context is also taken into account for this decision.

Parameters:
resource - a String represents the resource, for example, a resource defined in ALES is "//app/policy/wls9ssm/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService", if want know current login user is permitted to perform a action on the resource, string passed as resource to this method should be "/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService"
action - a String represents the action to be performed on a resource, which should be a defined privilege name in ALES, for example, "execute"
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
grantedresources - a Collection of Strings represents resources from the resource passed in that the current login user can perform the action passed in , returned by the authorization system, it's an out parameter.
Returns:
true if the current login user has permission to perform the action on the resource, false otherwise.
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.

isAccessAllowedWithResponseAttribues

boolean isAccessAllowedWithResponseAttribues(java.lang.String resource,
                                             java.lang.String action,
                                             java.util.Map appContext,
                                             java.util.Map responseAttr)
                                             throws ALESControlException
Determines if current login user is permitted to access a specific resource with a specific action and gets response attributes returned by the authorization system. The application context is also taken into account for this decision.

Parameters:
resource - a String represents the resource, for example, a resource defined in ALES is "//app/policy/wls9ssm/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService", if want know current login user is permitted to perform a action on the resource, string passed as resource to this method should be "/ExampleApp_EAR/jpd/ExampleApp_Web/processes.ExampleProcess/performService"
action - a String represents the action to be performed on a resource, which should be a defined privilege name in ALES, for example, "execute"
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
responseAttr - a Map of name/value pairs of response attributes returned by the authorization system the name and value type is String, it's an out parameter.
Returns:
true if the current login user has permission to perform the action on the resource, false otherwise.
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.

recordEvent

void recordEvent(java.lang.String message,
                 java.util.Map appContext,
                 AuditSeverity severity)
                 throws ALESControlException
Sends an audit message to the audit service system. The message will be auditted by the audit providers configured in the system.

Parameters:
message - a String repesents the message to pass to the audit system
appContext - a Map of name/value pairs of application context attributes, the name type is String and value type is Object
severity - a AuditSeverity represents the severity of the audit message, could be AuditSeverity.INFORMATIONAL, AuditSeverity.WARNING, AuditSeverity.ERROR, AuditSeverity.SUCCESS or AuditSeverity.FAILURE
Throws:
ALESControlException - an ALESControlException is thrown if any exception caught while calling runtime security service.


Copyright © 2007 BEA Systems Inc. All Rights Reserved.