Style Intelligence v12.0

inetsoft.sree.security
Class AbstractSecurityProvider

java.lang.Object
  extended by inetsoft.sree.security.AbstractSecurityProvider
All Implemented Interfaces:
AuthenticationChangeListener, AuthenticationProvider, AuthorizationProvider, SecurityProvider, EventListener
Direct Known Subclasses:
CompositeSecurityProvider, FileSecurityProvider, VirtualSecurityProvider

public abstract class AbstractSecurityProvider
extends Object
implements SecurityProvider

A skeletal implementation of a security provider.

Since:
5.1

Field Summary
 
Fields inherited from interface inetsoft.sree.security.AuthenticationProvider
INDIVIDUAL
 
Constructor Summary
AbstractSecurityProvider(AuthenticationProvider authentication, AuthorizationProvider authorization)
          Creates a new instance of AbstractSecurityProvider.
 
Method Summary
 boolean authenticate(String user, Object credential)
          Check the authentication of specific entity.
 boolean authenticateFallbackAdmin(String user, Object credential)
          Authenticates an administrative user using an alternative mechanism.
 void authenticationChanged(AuthenticationChangeEvent event)
          Signals that a security object has been removed or renamed.
 boolean checkPermission(Principal principal, String resource, char access)
          Check the permission to access a resource.
 void clearCache()
          Clear the cached data.
 inetsoft.uql.util.Identity findIdentity(inetsoft.uql.util.Identity identity)
          Find the concrete identity in this security provider.
 AuthenticationProvider getAuthenticationProvider()
          Gets the module that provides authentication support to this security provider.
 AuthorizationProvider getAuthorizationProvider()
          Gets the module that provides authorization support to this security provider.
 String[] getEmails(String user)
          Deprecated. use User.getEmails() instead.
 Group getGroup(String name)
          Get a group by name.
 inetsoft.uql.util.Identity[] getGroupMembers(String groupName)
          Gets all members of a group.
 String[] getGroups()
          Get a list of all groups defined in the system.
 String[] getIndividualUsers()
          Get a list of all users not in any group except INDIVIDUAL.
 Permission getPermission(String resource)
          Get the permission of the specified type.
 Role getRole(String name)
          Get a role object from the role ID.
 inetsoft.uql.util.Identity[] getRoleMembers(String roleName)
          Gets the groups and users that have been assigned the specified role.
 String[] getRoles()
          Get a list of all roles in the system.
 String[] getRoles(String user)
          Get a list of all roles bound to specific user, include the 'Everyone' role.
 User getUser(String name)
          Get a user by name.
 String[] getUsers()
          Gets a list of all users in the system.
 String[] getUsers(String group)
          Get a list of all users in a group.
 void removePermission(String resource)
          Remove the user permission.
 void setPermission(String resource, Permission perm)
          Set the permission for specific resource.
 boolean supportGroupPermission()
          Check if provider support to allocate permission to group or not.
 void tearDown()
          Tear down the security provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSecurityProvider

public AbstractSecurityProvider(AuthenticationProvider authentication,
                                AuthorizationProvider authorization)
Creates a new instance of AbstractSecurityProvider.

Parameters:
authentication - the authentication provider.
authorization - the authorization provider.
Method Detail

getAuthenticationProvider

public AuthenticationProvider getAuthenticationProvider()
Gets the module that provides authentication support to this security provider.

Returns:
the authentication module.

getAuthorizationProvider

public AuthorizationProvider getAuthorizationProvider()
Gets the module that provides authorization support to this security provider.

Returns:
the authorization module.

getUsers

public String[] getUsers()
Gets a list of all users in the system.

Specified by:
getUsers in interface AuthenticationProvider
Returns:
a list of users.

getUser

public User getUser(String name)
Get a user by name.

Specified by:
getUser in interface AuthenticationProvider
Parameters:
name - the unique identifier of the user.
Returns:
the User object that encapsulates the properties of the user.

getEmails

@Deprecated
public String[] getEmails(String user)
Deprecated. use User.getEmails() instead.

Get a list of all emails for a user.

Specified by:
getEmails in interface AuthenticationProvider
Parameters:
user - the unique identifier for the user.
Returns:
list of emails.

getGroup

public Group getGroup(String name)
Get a group by name.

Specified by:
getGroup in interface AuthenticationProvider
Parameters:
name - the name of the group.
Returns:
the named group or null if no such group exists.

getUsers

public String[] getUsers(String group)
Get a list of all users in a group.

Specified by:
getUsers in interface AuthenticationProvider
Parameters:
group - the name of the group.
Returns:
list of users

getIndividualUsers

public String[] getIndividualUsers()
Get a list of all users not in any group except INDIVIDUAL.

Specified by:
getIndividualUsers in interface AuthenticationProvider
Returns:
list of users

getRoles

public String[] getRoles()
Get a list of all roles in the system.

Specified by:
getRoles in interface AuthenticationProvider
Returns:
list of roles.

getRoles

public String[] getRoles(String user)
Get a list of all roles bound to specific user, include the 'Everyone' role.

Specified by:
getRoles in interface AuthenticationProvider
Parameters:
user - the unique identifier for the user.
Returns:
list of roles.

getRole

public Role getRole(String name)
Get a role object from the role ID.

Specified by:
getRole in interface AuthenticationProvider
Parameters:
name - the name of the role.
Returns:
the named role object of null if no such role exists.

getGroups

public String[] getGroups()
Get a list of all groups defined in the system. If groups are nested, only the top level groups will be returned.

Specified by:
getGroups in interface AuthenticationProvider
Returns:
list of groups.

authenticate

public boolean authenticate(String user,
                            Object credential)
Check the authentication of specific entity.

Specified by:
authenticate in interface AuthenticationProvider
Parameters:
user - the unique identification of the user.
credential - a wrapper for some secure message, such as the user ID and password.
Returns:
true if the authentication succeeded.

authenticateFallbackAdmin

public boolean authenticateFallbackAdmin(String user,
                                         Object credential)
Authenticates an administrative user using an alternative mechanism. This enables an administrator to log into the system if the configuration of the underlying security implementation has changed, not allowing a standard login.

Parameters:
user - the unique identification of the user.
credential - a wrapper for some secure message, such as the user ID and password. credential should be of the type String or DefaultTicket.
Returns:
true if the authentication succeeded, false otherwise.

getGroupMembers

public inetsoft.uql.util.Identity[] getGroupMembers(String groupName)
Gets all members of a group.

Parameters:
groupName - the name of the group.
Returns:
a list of users and groups that belong to the named group.

getRoleMembers

public inetsoft.uql.util.Identity[] getRoleMembers(String roleName)
Gets the groups and users that have been assigned the specified role.

Parameters:
roleName - the name of the role.
Returns:
the groups and users having the named role.

setPermission

public void setPermission(String resource,
                          Permission perm)
Set the permission for specific resource.

Specified by:
setPermission in interface AuthorizationProvider
Parameters:
resource - resource name, such as a replet register name or a saved report path.
perm - permission setting.

removePermission

public void removePermission(String resource)
Remove the user permission.

Specified by:
removePermission in interface AuthorizationProvider
Parameters:
resource - resource name, such as a replet path or a saved report path.

getPermission

public Permission getPermission(String resource)
Get the permission of the specified type.

Specified by:
getPermission in interface AuthorizationProvider
Parameters:
resource - resource name.
Returns:
permission setting or null if no permission is set for this resourece.

tearDown

public void tearDown()
Tear down the security provider.

Specified by:
tearDown in interface AuthenticationProvider
Specified by:
tearDown in interface AuthorizationProvider

checkPermission

public boolean checkPermission(Principal principal,
                               String resource,
                               char access)
Check the permission to access a resource.

Specified by:
checkPermission in interface SecurityProvider
Parameters:
principal - a Principal object that identifies the user. This will typically be an instance of SRPrincipal.
resource - resource name.
access - permission. 'r' for read, 'w' for write, and 'd' for delete.
Returns:
true if the permission is granted to this principal

authenticationChanged

public void authenticationChanged(AuthenticationChangeEvent event)
Signals that a security object has been removed or renamed.

Specified by:
authenticationChanged in interface AuthenticationChangeListener
Parameters:
event - the object that describes the change event.

findIdentity

public final inetsoft.uql.util.Identity findIdentity(inetsoft.uql.util.Identity identity)
Find the concrete identity in this security provider.

Specified by:
findIdentity in interface AuthenticationProvider
Returns:
the identity found in this security provider, null otherewise.

supportGroupPermission

public boolean supportGroupPermission()
Check if provider support to allocate permission to group or not.

Specified by:
supportGroupPermission in interface AuthorizationProvider

clearCache

public void clearCache()
Clear the cached data.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.