nl.surfnet.coin.teams.util
Interface ControllerUtil

All Known Implementing Classes:
ControllerUtilImpl

public interface ControllerUtil


Method Summary
 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
 

Method Detail

getTeam

Team getTeam(javax.servlet.http.HttpServletRequest request)
Get the team from the HttpServletRequest request.

Parameters:
request - the HttpServletRequest
Returns:
The Team team
Throws:
RuntimeException - if the team cannot be found

getTeamById

Team getTeamById(String teamId)
Get the team from the String teamId.

Parameters:
teamId - the String teamId
Returns:
The Team team
Throws:
RuntimeException - if the team cannot be found

hasUserAdministrativePrivileges

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.

Parameters:
person - Person
teamId - String the team Id for which the person's privileges are checked
Returns:
boolean true/code> if the user is admin AND/OR manager false if the user isn't

hasUserAdminPrivileges

boolean hasUserAdminPrivileges(nl.surfnet.coin.api.client.domain.Person person,
                               String teamId)
Checks if the current user has admin privileges for a given team.

Parameters:
person - Person
teamId - String the team Id for which the person's privileges are checked
Returns:
boolean true/code> if the user is admin AND/OR manager false if the user isn't

isPersonMemberOfTeam

boolean isPersonMemberOfTeam(String personId,
                             Team team)
Check if a Person is member of the given Team

Parameters:
personId - String the person identifier
team - Team the team
Returns:
true if the user is member of the team, false if the user isn't member

getMimeMultipartMessageBody

javax.mail.internet.MimeMultipart getMimeMultipartMessageBody(String plainText,
                                                              String html)
                                                              throws javax.mail.MessagingException
Makes MimeMultipart with a plain text and html version of the mail

Parameters:
plainText - contents of the plain text part of the mail
html - contents of the html part of the mail
Returns:
MimeMultipart
Throws:
{@link - MessagingException} if making the multipart fails
javax.mail.MessagingException


Copyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.