org.sakaiproject.component.common.authorization
Class AuthorizationManagerImpl

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.component.common.authorization.AuthorizationManagerImpl
All Implemented Interfaces:
AuthorizationManager, InitializingBean

public class AuthorizationManagerImpl
extends HibernateDaoSupport
implements AuthorizationManager

Version:
$Id: AuthorizationManagerImpl.java 632 2005-07-14 21:22:50Z janderse@umich.edu $
Author:
Jarrod Lannan

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AuthorizationManagerImpl()
           
 
Method Summary
 Authorization createAuthorization(String agentUuid, String permissionsUuid, String nodeUuid)
           
 Authorization createAuthorization(String agentUuid, String permissionsUuid, String nodeUuid, Date effectiveDate, Date expirationDate)
           
 void deleteAuthorization(Authorization authorization)
          Delete Authorization.
 Authorization getAuthorization(String uuid)
          Retrieve an Authorization by UUID.
 List getSignificantPropertyNames(Object o)
           
 void init()
           
 boolean isAuthorized(PermissionsManager permissionsManager, Permissions permissions, String nodeUuid)
          Since no AgentUuid is passed, the currently logged in user will be used.
 boolean isAuthorized(String agentUuid, PermissionsManager permissionsManager, Permissions permissions, String nodeUuid)
          The combination of functionType and signficantBits create the "what".
 boolean isDenySetOnPermissions(List searchPropertyNames, Object propertiesObject)
           
 void saveAuthorization(Authorization authorization)
          Persist Authorization.
 void setAgentGroupManager(AgentGroupManager agentGroupManager)
           
 void setIdManager(UuidManager idManager)
           
 void setPersistableHelper(PersistableHelper persistableHelper)
           
 void setSuperStructureManager(SuperStructureManager superStructureManager)
           
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationManagerImpl

public AuthorizationManagerImpl()
Method Detail

init

public void init()

createAuthorization

public Authorization createAuthorization(String agentUuid,
                                         String permissionsUuid,
                                         String nodeUuid)
Specified by:
createAuthorization in interface AuthorizationManager
See Also:
AuthorizationManager.createAuthorization(java.lang.String, java.lang.String, java.lang.String)

createAuthorization

public Authorization createAuthorization(String agentUuid,
                                         String permissionsUuid,
                                         String nodeUuid,
                                         Date effectiveDate,
                                         Date expirationDate)
Specified by:
createAuthorization in interface AuthorizationManager
See Also:
AuthorizationManager.createAuthorization(java.lang.String, java.lang.String, java.lang.String, java.util.Date, java.util.Date)

getAuthorization

public Authorization getAuthorization(String uuid)
Description copied from interface: AuthorizationManager
Retrieve an Authorization by UUID.

Specified by:
getAuthorization in interface AuthorizationManager
Parameters:
uuid -
Returns:
See Also:
AuthorizationManager.getAuthorization(java.lang.String)

saveAuthorization

public void saveAuthorization(Authorization authorization)
Description copied from interface: AuthorizationManager
Persist Authorization.

Specified by:
saveAuthorization in interface AuthorizationManager
Parameters:
authorization -
See Also:
AuthorizationManager.saveAuthorization(org.sakaiproject.api.common.authorization.Authorization)

deleteAuthorization

public void deleteAuthorization(Authorization authorization)
Description copied from interface: AuthorizationManager
Delete Authorization.

Specified by:
deleteAuthorization in interface AuthorizationManager
Parameters:
authorization -
See Also:
AuthorizationManager.deleteAuthorization(org.sakaiproject.api.common.authorization.Authorization)

isAuthorized

public boolean isAuthorized(PermissionsManager permissionsManager,
                            Permissions permissions,
                            String nodeUuid)
Description copied from interface: AuthorizationManager
Since no AgentUuid is passed, the currently logged in user will be used. The combination of functionType and signficantBits create the "what".

Specified by:
isAuthorized in interface AuthorizationManager
Parameters:
permissionsManager - The PermissionsManager that will be queried by AuthorizationManager.
permissions - The "function".
nodeUuid - The "where".
Returns:
TRUE if the Agent is authorized; FALSE if Agent is not authorized.
See Also:
AuthorizationManager.isAuthorized(org.sakaiproject.api.common.authorization.PermissionsManager, org.sakaiproject.api.common.authorization.Permissions, java.lang.String)

isAuthorized

public boolean isAuthorized(String agentUuid,
                            PermissionsManager permissionsManager,
                            Permissions permissions,
                            String nodeUuid)
Description copied from interface: AuthorizationManager
The combination of functionType and signficantBits create the "what".

Specified by:
isAuthorized in interface AuthorizationManager
Parameters:
agentUuid - The "who".
permissionsManager - The PermissionsManager that will be queried by AuthorizationManager.
permissions - The "function".
nodeUuid - The "where".
Returns:
TRUE if the Agent is authorized; FALSE if Agent is not authorized.
See Also:
AuthorizationManager.isAuthorized(java.lang.String, org.sakaiproject.api.common.authorization.PermissionsManager, org.sakaiproject.api.common.authorization.Permissions, java.lang.String)

isDenySetOnPermissions

public boolean isDenySetOnPermissions(List searchPropertyNames,
                                      Object propertiesObject)
Parameters:
searchPropertyNames - the property names if interest
Returns:
true if deny is set on any permissions, false otherwise

getSignificantPropertyNames

public List getSignificantPropertyNames(Object o)
Parameters:
o - the Permissions object
Returns:
List of property names queried

setAgentGroupManager

public void setAgentGroupManager(AgentGroupManager agentGroupManager)
Parameters:
agentGroupManager - The agentGroupManager to set.

setIdManager

public void setIdManager(UuidManager idManager)
Parameters:
idManager - The idManager to set.

setSuperStructureManager

public void setSuperStructureManager(SuperStructureManager superStructureManager)
Parameters:
superStructureManager - The superStructureManager to set.

setPersistableHelper

public void setPersistableHelper(PersistableHelper persistableHelper)
Parameters:
persistableHelper - The persistableHelper to set.