Class RatingValidationManagementService


  • public final class RatingValidationManagementService
    extends Object
    Service to manage ration validation
    • Method Detail

      • validateRating

        public static String validateRating​(javax.servlet.http.HttpServletRequest request,
                                            fr.paris.lutece.portal.service.security.LuteceUser user,
                                            String strIdResource,
                                            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​(String strIdExtendableResource,
                                        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​(String strIdExtendableResource,
                                              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