Class RatingSecurityService
java.lang.Object
fr.paris.lutece.plugins.extend.modules.rating.service.security.RatingSecurityService
- All Implemented Interfaces:
IRatingSecurityService
@ApplicationScoped
@Named("extend-rating.ratingSecurityService")
public class RatingSecurityService
extends Object
implements IRatingSecurityService
RatingSecurityService
-
Field Summary
Fields inherited from interface fr.paris.lutece.plugins.extend.modules.rating.service.security.IRatingSecurityService
BEAN_SERVICE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAccess(fr.paris.lutece.portal.service.security.LuteceUser user) Check if any user rating process in progressbooleancanDeleteVote(RatingExtenderConfig config, fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated) can delete his vote.booleancanDeleteVote(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated) can delete his vote.booleancanVote(RatingExtenderConfig config, fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated or not) can vote or not.booleancanVote(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated or not) can vote or not.voidfreeAccess(fr.paris.lutece.portal.service.security.LuteceUser user) free the user rating processbooleanhasAlreadyVoted(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) true if the use has already VotedbooleanisVoteClosed(RatingExtenderConfig config) Check if the Votes are closed
-
Constructor Details
-
RatingSecurityService
public RatingSecurityService()
-
-
Method Details
-
canVote
public boolean canVote(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) throws fr.paris.lutece.portal.service.security.UserNotSignedException Check if the given user (authenticated or not) can vote or not.- Specified by:
canVotein interfaceIRatingSecurityService- Parameters:
user- the LuteceUserstrIdExtendableResource- the id extendable resourcestrExtendableResourceType- the extendable resource type- Returns:
- true, if successful
- Throws:
fr.paris.lutece.portal.service.security.UserNotSignedException- the UserNotSignedException
-
canVote
public boolean canVote(RatingExtenderConfig config, fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) throws fr.paris.lutece.portal.service.security.UserNotSignedException Check if the given user (authenticated or not) can vote or not.- Specified by:
canVotein interfaceIRatingSecurityService- Parameters:
config- the RatingExtenderConfiguser- the LuteceUserstrIdExtendableResource- the id extendable resourcestrExtendableResourceType- the extendable resource type- Returns:
- true, if successful
- Throws:
fr.paris.lutece.portal.service.security.UserNotSignedException- the UserNotSignedException
-
canDeleteVote
public boolean canDeleteVote(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated) can delete his vote.- Specified by:
canDeleteVotein interfaceIRatingSecurityService- Parameters:
user- the LuteceUserstrIdExtendableResource- the id extendable resourcestrExtendableResourceType- the extendable resource type- Returns:
- true, if successful
-
canDeleteVote
public boolean canDeleteVote(RatingExtenderConfig config, fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) Check if the given user (authenticated) can delete his vote.- Specified by:
canDeleteVotein interfaceIRatingSecurityService- Parameters:
config- the RatingExtenderConfiguser- the LuteceUserstrIdExtendableResource- the id extendable resourcestrExtendableResourceType- the extendable resource type- Returns:
- true, if successful
-
isVoteClosed
Check if the Votes are closed- Specified by:
isVoteClosedin interfaceIRatingSecurityService- Parameters:
config- the rating config- Returns:
- true if the votes are closed
-
hasAlreadyVoted
public boolean hasAlreadyVoted(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdExtendableResource, String strExtendableResourceType) true if the use has already Voted- Specified by:
hasAlreadyVotedin interfaceIRatingSecurityServicestrIdExtendableResource- the str id extendable resourcestrExtendableResourceType- the str extendable resource type
-
canAccess
public boolean canAccess(fr.paris.lutece.portal.service.security.LuteceUser user) Description copied from interface:IRatingSecurityServiceCheck if any user rating process in progress- Specified by:
canAccessin interfaceIRatingSecurityService- Returns:
- true if no rating in progress, false if User rating in progress
-
freeAccess
public void freeAccess(fr.paris.lutece.portal.service.security.LuteceUser user) Description copied from interface:IRatingSecurityServicefree the user rating process- Specified by:
freeAccessin interfaceIRatingSecurityService
-