org.sakaiproject.tool.assessment.facade.authz.standalone
Class AuthzQueriesFacade

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.tool.assessment.facade.authz.standalone.AuthzQueriesFacade
All Implemented Interfaces:
AuthzQueriesFacadeAPI, InitializingBean

public class AuthzQueriesFacade
extends HibernateDaoSupport
implements AuthzQueriesFacadeAPI

Description: Facade for AuthZ queries, standalone version.

Sakai Project Copyright (c) 2005

Author:
Rachel Gollub , Ed Smiley

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AuthzQueriesFacade()
           
 
Method Summary
 boolean checkAuthorization(String agentId, String functionId, String qualifierId)
          UNIMPLEMENTED.
 boolean checkMembership(String siteId)
          Check if member of site.
 AuthorizationData createAuthorization(String agentId, String functionId, String qualifierId)
          Create an authorization record for {agentId} authorized to do {function} to {qualifier}
 ArrayList getAssessments(String agentId, String functionId)
          UNIMPLEMENTED.
 ArrayList getAssessmentsByAgentAndFunction(String agentId, String functionId)
          UNIMPLEMENTED.
 List getAuthorizationByAgentAndFunction(String agentId, String functionId)
          This returns a HashMap containing authorization data.
 List getAuthorizationByFunctionAndQualifier(String functionId, String qualifierId)
          Get authorization list by qualifier and function.
 HashMap getAuthorizationToViewAssessments(String agentId)
          This returns a HashMap containing (String a.qualiferId, AuthorizationData a) agentId is a site for now but can be a user
 boolean hasPrivilege(String functionName)
           
 boolean isAuthorized(String agentId, String function, String qualifier)
          Is the agent {agentId} authorized to do {function} to {qualifier}?
 void removeAuthorizationByQualifier(String qualifierId, boolean isPublishedAssessment)
          Remove authorization from qualifier (target).
 
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

AuthzQueriesFacade

public AuthzQueriesFacade()
Method Detail

hasPrivilege

public boolean hasPrivilege(String functionName)
Specified by:
hasPrivilege in interface AuthzQueriesFacadeAPI

isAuthorized

public boolean isAuthorized(String agentId,
                            String function,
                            String qualifier)
Is the agent {agentId} authorized to do {function} to {qualifier}?

Specified by:
isAuthorized in interface AuthzQueriesFacadeAPI
Parameters:
agentId - the agent id.
Returns:
true if authorized (always in standalone)

createAuthorization

public AuthorizationData createAuthorization(String agentId,
                                             String functionId,
                                             String qualifierId)
Create an authorization record for {agentId} authorized to do {function} to {qualifier}

Specified by:
createAuthorization in interface AuthzQueriesFacadeAPI
Parameters:
agentId - the agent id.
functionId - the function to be performed.
qualifierId - the target of the function.
Returns:
the authorization data

removeAuthorizationByQualifier

public void removeAuthorizationByQualifier(String qualifierId,
                                           boolean isPublishedAssessment)
Remove authorization from qualifier (target).

Specified by:
removeAuthorizationByQualifier in interface AuthzQueriesFacadeAPI
Parameters:
qualifierId - the target.

getAuthorizationToViewAssessments

public HashMap getAuthorizationToViewAssessments(String agentId)
This returns a HashMap containing (String a.qualiferId, AuthorizationData a) agentId is a site for now but can be a user

Specified by:
getAuthorizationToViewAssessments in interface AuthzQueriesFacadeAPI
Parameters:
agentId - the agent id
Returns:
HashMap containing qualiferId, AuthorizationData

getAuthorizationByAgentAndFunction

public List getAuthorizationByAgentAndFunction(String agentId,
                                               String functionId)
This returns a HashMap containing authorization data.

Specified by:
getAuthorizationByAgentAndFunction in interface AuthzQueriesFacadeAPI
Parameters:
agentId - is a site for now but can be a user
functionId - the function to be performed.
Returns:
HashMap containing (String a.qualiferId, AuthorizationData a)

getAuthorizationByFunctionAndQualifier

public List getAuthorizationByFunctionAndQualifier(String functionId,
                                                   String qualifierId)
Get authorization list by qualifier and function.

Specified by:
getAuthorizationByFunctionAndQualifier in interface AuthzQueriesFacadeAPI
Parameters:
functionId - the function to be performed.
qualifierId - the target of the function.
Returns:
the list of authorizations.

checkMembership

public boolean checkMembership(String siteId)
Check if member of site.

Specified by:
checkMembership in interface AuthzQueriesFacadeAPI
Parameters:
siteId - the site id
Returns:
true if a member.

checkAuthorization

public boolean checkAuthorization(String agentId,
                                  String functionId,
                                  String qualifierId)
UNIMPLEMENTED. Check the agent {agentId} authorized to do {function} to {qualifier}?

Parameters:
agentId - the agent id.
functionId - the function to be performed.
qualifierId - the target of the function.
Returns:
--throw UnsupportedOperationException

getAssessments

public ArrayList getAssessments(String agentId,
                                String functionId)
UNIMPLEMENTED. Warning. Oddly named method. Just following the convention. Actually using select from ...AuthorizationData...

Parameters:
agentId - the agent id.
functionId - the function to be performed.
Returns:
--throw UnsupportedOperationException

getAssessmentsByAgentAndFunction

public ArrayList getAssessmentsByAgentAndFunction(String agentId,
                                                  String functionId)
UNIMPLEMENTED.

Parameters:
agentId - the agent id.
functionId - the function to be performed.
Returns:
--throw UnsupportedOperationException