public class SurveyAccessHelper extends AbstractLogEnabled implements Component, ThreadSafe, Serviceable
| Modifier and Type | Field and Description |
|---|---|
protected SurveyAnswerDao |
_answerDao
The ametys object resolver.
|
protected org.ametys.runtime.group.GroupsManager |
_foGroupsManager
The FO groups manager
|
static java.lang.String |
ROLE
Avalon role
|
| Constructor and Description |
|---|
SurveyAccessHelper() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCookieName(Request request,
java.lang.String surveyId)
Return the name of cookie if the survey was already taken or
null otherwise. |
java.util.Date |
getSubmissionDate(java.lang.String surveyId,
java.lang.String login)
Returns the date on which the user answered to the survey or
null if he was never answered |
boolean |
isUserGranted(Survey survey,
java.lang.String login)
Test if the current user has the right to take the survey.
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic static final java.lang.String ROLE
protected org.ametys.runtime.group.GroupsManager _foGroupsManager
protected SurveyAnswerDao _answerDao
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic boolean isUserGranted(Survey survey, java.lang.String login)
survey - the survey.login - the user login.public java.util.Date getSubmissionDate(java.lang.String surveyId,
java.lang.String login)
null if he was never answeredsurveyId - the survey ID.login - the user login.null if the user never took the survey.public java.lang.String getCookieName(Request request, java.lang.String surveyId)
null otherwise.request - the request.surveyId - the survey ID.null otherwise.Copyright © 2010 Anyware Services. All Rights Reserved.