@Component(value="controllerUtil") public class ControllerUtilImpl extends Object implements ControllerUtil
| Constructor and Description |
|---|
ControllerUtilImpl() |
| Modifier and Type | Method and Description |
|---|---|
javax.mail.internet.MimeMultipart |
getMimeMultipartMessageBody(String plainText,
String html)
Makes
MimeMultipart with a plain text and html version of the mail |
Team |
getTeam(javax.servlet.http.HttpServletRequest request)
Get the team from the
HttpServletRequest request. |
Team |
getTeamById(String teamId)
Get the team from the
String teamId. |
boolean |
hasUserAdministrativePrivileges(nl.surfnet.coin.api.client.domain.Person person,
String teamId)
Checks if the current user has administrative privileges (whether he is admin OR manager) for a given team.
|
boolean |
hasUserAdminPrivileges(nl.surfnet.coin.api.client.domain.Person person,
String teamId)
Checks if the current user has admin privileges for a given team.
|
boolean |
isPersonMemberOfTeam(String personId,
Team team)
Check if a
Person is member of the given Team |
public Team getTeam(javax.servlet.http.HttpServletRequest request)
HttpServletRequest request.getTeam in interface ControllerUtilrequest - the HttpServletRequestTeam teamRuntimeException - if the team cannot be foundpublic Team getTeamById(String teamId)
String teamId.getTeamById in interface ControllerUtilteamId - the String teamIdTeam teamRuntimeException - if the team cannot be foundpublic boolean hasUserAdministrativePrivileges(nl.surfnet.coin.api.client.domain.Person person,
String teamId)
hasUserAdministrativePrivileges in interface ControllerUtilperson - PersonteamId - String the team Id for which the person's privileges are checkedboolean true/code> if the user is admin AND/OR manager false if the user isn'tpublic boolean hasUserAdminPrivileges(nl.surfnet.coin.api.client.domain.Person person,
String teamId)
hasUserAdminPrivileges in interface ControllerUtilperson - PersonteamId - String the team Id for which the person's privileges are checkedboolean true/code> if the user is admin AND/OR manager false if the user isn'tpublic boolean isPersonMemberOfTeam(String personId, Team team)
Person is member of the given TeamisPersonMemberOfTeam in interface ControllerUtilpersonId - String the person identifierteam - Team the teampublic javax.mail.internet.MimeMultipart getMimeMultipartMessageBody(String plainText, String html) throws javax.mail.MessagingException
ControllerUtilMimeMultipart with a plain text and html version of the mailgetMimeMultipartMessageBody in interface ControllerUtilplainText - contents of the plain text part of the mailhtml - contents of the html part of the mailjavax.mail.MessagingExceptionCopyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.