Package org.cyclos.security.users
Class TransactionFeedbackServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
- org.cyclos.security.users.TransactionFeedbackServiceSecurity
-
- All Implemented Interfaces:
CRUDService<TransactionFeedbackDTO,TransactionFeedbackData,TransactionVO>,CRUDWithConfirmationPasswordService<TransactionFeedbackDTO,TransactionFeedbackData,TransactionVO>,Service,TransactionFeedbackService
@Security public class TransactionFeedbackServiceSecurity extends CRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO> implements TransactionFeedbackService
Security forTransactionFeedbackService
-
-
Field Summary
-
Fields inherited from class org.cyclos.security.CRUDServiceSecurity
entityClass
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description TransactionFeedbackServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckCreateNew(TransactionVO transaction)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notLongcomment(TransactionVO transaction, ReferenceLevel level, String comment)Creates or edits the comments for the feedback of the given payment (be it a direct/scheduled/recurring payment)protected voidcustomizeData(TransactionFeedbackData data)Can be overridden in order to process the returned data object for the given entitybooleandoHasManageAccess(TransactionFeedback entity)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(TransactionFeedback entity)Should be implemented in order to return whether the caller is allowed to view the given entity.TransactionFeedbackDatagetDataFromTransaction(TransactionVO vo)Retrieve the data but from the transaction instead of using the feedback's idTransactionFeedbackDatagetGiveData(TransactionVO transaction)Return data for create or modify a feedback.protected TransactionFeedbackServiceLocalgetImplementation()Should be implemented in order to return the actual implementation of the serviceTransactionFeedbackDatagetReplyData(TransactionVO transaction)Return data for reply for an already given feedback.
The logged user must be the payment's receiver withPermission.MY_TRANSACTION_FEEDBACKS_RECEIVEpermission.TransactionFeedbackSearchDatagetSearchData(UserLocatorVO locator)Returns data used for search, like results and statisticsReferenceStatisticsVOgetStatistics(@NotNull ReferenceStatisticsParams params)Returns reference statistics for the given user.TransactionFeedbackVOgetTransactionFeedback(TransactionVO transaction)Returns the transaction feedback related to the given paymentbooleanisAccessible(SessionData sessionData, TransactionFeedback entity)Must be implemented in order to determine whether the given entity is accessible for the given session data.List<UserVO>listIgnoredUsers()Returns all users ignored for feedbacks for the logged userbooleanmarkAsIgnored(UserLocatorVO locator, boolean ignored)Adds/Removes the given user to/from the logged user's ignore list for feedbacks.voidremoveFromTransaction(TransactionVO vo)Removes (logically) the feedback associated to the given transaction.Longreply(TransactionVO transaction, String replyComments)Creates or edits the comments for the feedback of the given payment (be it a transfer os scheduled payment)Page<TransactionFeedbackEntryVO>search(TransactionFeedbackQuery query)Searches for transaction feedbacks for a given owner, according to the given queryPage<TransactionResultVO>searchTransactionsAwaitingFeedback(TransactionsAwaitingFeedbackQuery query)Searches for transactions awaiting feedback by the given from user.voidsetFeedbackActions(BasePaymentData data)Used by direct/scheduled/recurring payment servicesvoidupdateFeedbackFromTransaction(TransactionVO vo, TransactionFeedbackUpdateDTO update)Updates the feedback associated to the given transaction as an admin/broker-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
canPerformOperation, canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, onBeforeSave, remove, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityCheck, save, saveWithConfirmationPassword
-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
-
-
-
Method Detail
-
comment
public Long comment(TransactionVO transaction, ReferenceLevel level, String comment) throws FrameworkException, IllegalActionException
Description copied from interface:TransactionFeedbackServiceCreates or edits the comments for the feedback of the given payment (be it a direct/scheduled/recurring payment)- Specified by:
commentin interfaceTransactionFeedbackService- Throws:
IllegalActionException- When the given payment cannot receive a feedback comment (feedbacks not used, already replied or timed out)FrameworkException
-
doHasManageAccess
public boolean doHasManageAccess(TransactionFeedback entity)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to manage the given entity, for the given operation- Specified by:
doHasManageAccessin classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
doHasViewAccess
public boolean doHasViewAccess(TransactionFeedback entity)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to view the given entity.- Specified by:
doHasViewAccessin classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
getDataFromTransaction
public TransactionFeedbackData getDataFromTransaction(TransactionVO vo)
Description copied from interface:TransactionFeedbackServiceRetrieve the data but from the transaction instead of using the feedback's id- Specified by:
getDataFromTransactionin interfaceTransactionFeedbackService
-
getGiveData
public TransactionFeedbackData getGiveData(TransactionVO transaction)
Description copied from interface:TransactionFeedbackServiceReturn data for create or modify a feedback. This method is similar to the#getDataForNew(TransactionVO)but it doesn't throw aPermissionDeniedExceptionThe logged user must be the payment's payer.- Specified by:
getGiveDatain interfaceTransactionFeedbackService
-
getReplyData
public TransactionFeedbackData getReplyData(TransactionVO transaction)
Description copied from interface:TransactionFeedbackServiceReturn data for reply for an already given feedback.
The logged user must be the payment's receiver withPermission.MY_TRANSACTION_FEEDBACKS_RECEIVEpermission.- Specified by:
getReplyDatain interfaceTransactionFeedbackService
-
getSearchData
public TransactionFeedbackSearchData getSearchData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:TransactionFeedbackServiceReturns data used for search, like results and statistics- Specified by:
getSearchDatain interfaceTransactionFeedbackService- Throws:
FrameworkException
-
getStatistics
public ReferenceStatisticsVO getStatistics(@NotNull @NotNull ReferenceStatisticsParams params) throws FrameworkException
Description copied from interface:TransactionFeedbackServiceReturns reference statistics for the given user. The params allows periods. The order of the resulting periods is the same as the order of the input periods. If no periods are specified, 3 statistics are returned: all time and last 30 days. The maximum allowed number of periods is 5.- Specified by:
getStatisticsin interfaceTransactionFeedbackService- Throws:
FrameworkException
-
getTransactionFeedback
public TransactionFeedbackVO getTransactionFeedback(TransactionVO transaction) throws FrameworkException
Description copied from interface:TransactionFeedbackServiceReturns the transaction feedback related to the given payment- Specified by:
getTransactionFeedbackin interfaceTransactionFeedbackService- Throws:
FrameworkException
-
isAccessible
public boolean isAccessible(SessionData sessionData, TransactionFeedback entity)
Description copied from class:CRUDServiceSecurityMust be implemented in order to determine whether the given entity is accessible for the given session data. This method shouldn't check the same condition asCRUDServiceSecurity.hasViewAccess(BaseEntity). If the only condition for an entity isCRUDServiceSecurity.hasViewAccess(BaseEntity), this method should return false.- Specified by:
isAccessiblein classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
listIgnoredUsers
public List<UserVO> listIgnoredUsers()
Description copied from interface:TransactionFeedbackServiceReturns all users ignored for feedbacks for the logged user- Specified by:
listIgnoredUsersin interfaceTransactionFeedbackService
-
markAsIgnored
public boolean markAsIgnored(UserLocatorVO locator, boolean ignored)
Description copied from interface:TransactionFeedbackServiceAdds/Removes the given user to/from the logged user's ignore list for feedbacks.- Specified by:
markAsIgnoredin interfaceTransactionFeedbackService- Returns:
- true if the user was not ignored and now is ignored and vice versa.
-
removeFromTransaction
public void removeFromTransaction(TransactionVO vo)
Description copied from interface:TransactionFeedbackServiceRemoves (logically) the feedback associated to the given transaction. It's used only by the REST layer because the paymentFeedback REST API works with transaction's id instead of feedback's id.
Only for admin/brokers with manage permission.- Specified by:
removeFromTransactionin interfaceTransactionFeedbackService
-
reply
public Long reply(TransactionVO transaction, String replyComments) throws FrameworkException, IllegalActionException
Description copied from interface:TransactionFeedbackServiceCreates or edits the comments for the feedback of the given payment (be it a transfer os scheduled payment)- Specified by:
replyin interfaceTransactionFeedbackService- Throws:
IllegalActionException- When the given payment cannot receive a feedback reply (feedbacks not used or timed out)FrameworkException
-
search
public Page<TransactionFeedbackEntryVO> search(TransactionFeedbackQuery query)
Description copied from interface:TransactionFeedbackServiceSearches for transaction feedbacks for a given owner, according to the given query- Specified by:
searchin interfaceTransactionFeedbackService
-
searchTransactionsAwaitingFeedback
public Page<TransactionResultVO> searchTransactionsAwaitingFeedback(TransactionsAwaitingFeedbackQuery query)
Description copied from interface:TransactionFeedbackServiceSearches for transactions awaiting feedback by the given from user. The logged must have permission to give feedback or manage feedback (manager)- Specified by:
searchTransactionsAwaitingFeedbackin interfaceTransactionFeedbackService
-
setFeedbackActions
public void setFeedbackActions(BasePaymentData data)
Used by direct/scheduled/recurring payment services
-
updateFeedbackFromTransaction
public void updateFeedbackFromTransaction(TransactionVO vo, TransactionFeedbackUpdateDTO update)
Description copied from interface:TransactionFeedbackServiceUpdates the feedback associated to the given transaction as an admin/broker- Specified by:
updateFeedbackFromTransactionin interfaceTransactionFeedbackService
-
checkCreateNew
protected void checkCreateNew(TransactionVO transaction)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
customizeData
protected void customizeData(TransactionFeedbackData data)
Description copied from class:CRUDServiceSecurityCan be overridden in order to process the returned data object for the given entity- Overrides:
customizeDatain classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
getImplementation
protected TransactionFeedbackServiceLocal getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<TransactionFeedbackDTO,TransactionFeedback,TransactionFeedbackData,TransactionVO>
-
-