Class RatingValidationManagementService


  • public final class RatingValidationManagementService
    extends java.lang.Object
    Service to manage ration validation
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canCancelRating​(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType, fr.paris.lutece.portal.service.security.LuteceUser user)
      check if the rating can be done
      static boolean canRating​(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType, fr.paris.lutece.portal.service.security.LuteceUser user)
      check if the rating can be done
      static java.lang.String validateRating​(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.security.LuteceUser user, java.lang.String strIdResource, java.lang.String strResourceTypeKey, float fRatingValue)
      Check if a user is allowed to validate a resource
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • validateRating

        public static java.lang.String validateRating​(javax.servlet.http.HttpServletRequest request,
                                                      fr.paris.lutece.portal.service.security.LuteceUser user,
                                                      java.lang.String strIdResource,
                                                      java.lang.String strResourceTypeKey,
                                                      float fRatingValue)
        Check if a user is allowed to validate a resource
        Parameters:
        request - The request
        user - The user that wants to rate a resource
        strIdResource - the id of the resource
        strResourceTypeKey - The resource type key
        fRatingValue - The rating value
        Returns:
        The URL to redirect the user if he is not allowed to rate the resource, or null if he is allowed
      • canRating

        public static boolean canRating​(java.lang.String strIdExtendableResource,
                                        java.lang.String strExtendableResourceType,
                                        fr.paris.lutece.portal.service.security.LuteceUser user)
        check if the rating can be done
        Parameters:
        strIdResource - the id of the resource
        strResourceTypeKey - The resource type key
        user - The user that wants to rate a resource
        Returns:
        true if the rating can be done
      • canCancelRating

        public static boolean canCancelRating​(java.lang.String strIdExtendableResource,
                                              java.lang.String strExtendableResourceType,
                                              fr.paris.lutece.portal.service.security.LuteceUser user)
        check if the rating can be done
        Parameters:
        strIdResource - the id of the resource
        strResourceTypeKey - The resource type key
        user - The user that wants to rate a resource
        Returns:
        true if the rating can be done