|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.outerj.xreporter.authorisation.AuthorisationManagerImpl
Default implementation of the AuthorisationManager. Access to reports is allowed based on the roles of the user. Access to datasources is controlled by a datasource authorisation code. The association between roles and report id's is managed in a database table. The association between userss and datasource authorisation codes is also managed in a database table. The association between a datasource authorisation code and datasources is managed in an XML file.
Nested Class Summary | |
protected class |
AuthorisationManagerImpl.AuthorisationCodesHandler
ContentHandler to parse the file with datasource authorisation codes. |
Field Summary | |
protected java.lang.String |
accessControlStatementBase
|
protected java.lang.String |
allAllowedReportsStatementBase
|
protected java.lang.String |
authorisationCodesLocation
Location of the file containing the authorisation code to datasource id mapping. |
protected java.lang.String |
authorisationCodeStatement
SQL statement to get the authorisation code of a user |
protected java.util.Properties |
connectionProperties
|
protected ConnectionProvider |
connectionProvider
|
protected ConnectionProviderManager |
connectionProviderManager
|
protected java.util.Map |
dataSourcesByAuthorisationCode
The values in this map are Sets of authorisation codes. |
Fields inherited from interface org.outerj.xreporter.authorisation.AuthorisationManager |
ROLE |
Constructor Summary | |
AuthorisationManagerImpl()
|
Method Summary | |
void |
addRoleInClause(User user,
java.lang.StringBuffer statement)
|
int |
bindRoleInClause(User user,
java.sql.PreparedStatement stmt,
int start)
|
boolean |
canAccessDataSource(User user,
java.lang.String dataSourceId)
|
boolean |
canAccessReport(User user,
java.lang.String reportDefinitionId)
|
void |
compose(org.apache.avalon.framework.component.ComponentManager componentManager)
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
java.util.Set |
getAllowedDataSourceIds(User user)
Returns a set of all data source id's (= String objects) that the user is allowed to access. |
java.util.Set |
getAllowedReportDefinitionIds(User user)
Returns a set of all report definition id's (= String objects) that the user is allowed to access. |
java.lang.String |
getAuthorisationCode(User user)
Fetches the user's authorisation code from the database. |
void |
initialize()
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Properties connectionProperties
protected ConnectionProviderManager connectionProviderManager
protected ConnectionProvider connectionProvider
protected java.lang.String accessControlStatementBase
protected java.lang.String allAllowedReportsStatementBase
protected java.util.Map dataSourcesByAuthorisationCode
protected java.lang.String authorisationCodesLocation
protected java.lang.String authorisationCodeStatement
Constructor Detail |
public AuthorisationManagerImpl()
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager componentManager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
org.apache.avalon.framework.component.ComponentException
public void initialize() throws java.lang.Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
java.lang.Exception
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public boolean canAccessReport(User user, java.lang.String reportDefinitionId) throws AuthorisationException
canAccessReport
in interface AuthorisationManager
AuthorisationException
public java.util.Set getAllowedReportDefinitionIds(User user) throws AuthorisationException
AuthorisationManager
getAllowedReportDefinitionIds
in interface AuthorisationManager
AuthorisationException
public void addRoleInClause(User user, java.lang.StringBuffer statement)
public int bindRoleInClause(User user, java.sql.PreparedStatement stmt, int start) throws java.sql.SQLException
java.sql.SQLException
public boolean canAccessDataSource(User user, java.lang.String dataSourceId) throws AuthorisationException
canAccessDataSource
in interface AuthorisationManager
AuthorisationException
public java.util.Set getAllowedDataSourceIds(User user) throws AuthorisationException
AuthorisationManager
getAllowedDataSourceIds
in interface AuthorisationManager
AuthorisationException
public java.lang.String getAuthorisationCode(User user) throws AuthorisationException
AuthorisationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |