Class HelpFunctions


  • @Component
    public class HelpFunctions
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      HelpFunctions()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ValidationError> getConstraintViolation​(java.lang.Throwable cause)
      Searches to see if the exception has any constraint violations to report
      boolean isAuthorizedToMakeChange​(java.lang.String username)
      Checks to see if the authenticated user has access to modify the requested user's information
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HelpFunctions

        public HelpFunctions()
    • Method Detail

      • isAuthorizedToMakeChange

        public boolean isAuthorizedToMakeChange​(java.lang.String username)
        Checks to see if the authenticated user has access to modify the requested user's information
        Parameters:
        username - The user name of the user whose data is requested to be changed. This should either match the authenticated user or the authenticate must have the role ADMIN
        Returns:
        true if the user can make the modifications, otherwise an exception is thrown
      • getConstraintViolation

        public java.util.List<ValidationError> getConstraintViolation​(java.lang.Throwable cause)
        Searches to see if the exception has any constraint violations to report
        Parameters:
        cause - the exception to search
        Returns:
        constraint violations formatted for sending to the client