Package org.cyclos.security.system
Class CustomOperationServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<DTO,E,D,DP>
-
- org.cyclos.security.ConfigurationEntityCRUDServiceSecurity<CustomOperationDTO,CustomOperation,CustomOperationData,Void>
-
- org.cyclos.security.system.CustomOperationServiceSecurity
-
- All Implemented Interfaces:
CRUDService<CustomOperationDTO,CustomOperationData,Void>,CRUDWithConfirmationPasswordService<CustomOperationDTO,CustomOperationData,Void>,Service,CustomOperationService
@Security public class CustomOperationServiceSecurity extends ConfigurationEntityCRUDServiceSecurity<CustomOperationDTO,CustomOperation,CustomOperationData,Void> implements CustomOperationService
Security layer forCustomOperation
-
-
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 CustomOperationServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanManage()booleancanView()voidcheckCreateNew(Void param)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notprotected CustomOperationcheckRun(CustomOperationVO customOperationVO, SimpleEntity entity)protected booleandoHasManageAccess(CustomOperation entity)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(CustomOperation entity)Should be implemented in order to return whether the caller is allowed to view the given entity.PasswordInputDTOgetConfirmationPasswordInputForRun(RunCustomOperationDataParams params)Returns thePasswordInputDTOfor the confirmation password that would be required if executing the given custom operation.protected CRUDServiceLocal<CustomOperation,CustomOperationDTO,CustomOperationData,Void>getImplementation()Should be implemented in order to return the actual implementation of the serviceRunCustomOperationDatagetRunData(RunCustomOperationDataParams params)Returns data to run a custom operation.List<RunnableCustomOperationVO>getRunnableOperationsForAd(BasicAdVO ad)Lists the user custom operations scope =CustomOperationScope.ADVERTISEMENTthe logged user can run over the given advertisementList<RunnableCustomOperationVO>getRunnableOperationsForContact(ContactVO contact)Lists the user custom operations scope =CustomOperationScope.CONTACTthe logged user can run over the given contactList<RunnableCustomOperationVO>getRunnableOperationsForContactInfo(ContactInfoVO contactInfo)Lists the user custom operations scope =CustomOperationScope.CONTACT_INFOthe logged user can run over the given additional contact informationList<RunnableCustomOperationVO>getRunnableOperationsForRecord(RecordVO record)Lists the user custom operations scope =CustomOperationScope.RECORDthe logged user can run over the given recordList<RunnableCustomOperationVO>getRunnableOperationsForSystem()Lists the custom operations with scope =CustomOperationScope.SYSTEMthe logged user can runList<RunnableCustomOperationVO>getRunnableOperationsForTransfer(TransferVO transfer)Lists the custom operations with scope =CustomOperationScope.TRANSFERthe logged user can run over the given transferList<RunnableCustomOperationVO>getRunnableOperationsForUser(UserLocatorVO locator)Lists the user custom operations scope =CustomOperationScope.USERthe logged user can run over the given user (or self if null)List<CustomOperationResultVO>list()Lists all available custom operationsRunCustomOperationResultrun(RunCustomOperationDTO params)Runs a custom operation, returning the result with all type informationRunCustomOperationResultrunExternalRedirectCallback(RunExternalRedirectCallbackParams params)Runs the callback for a custom operation of type external redirect.voidsaveOrder(List<Long> ids)Saves the order according to the given operation ids-
Methods inherited from class org.cyclos.security.ConfigurationEntityCRUDServiceSecurity
isAccessible
-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
canPerformOperation, canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, customizeData, 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, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, 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
-
canManage
public boolean canManage()
-
canView
public boolean canView()
-
checkCreateNew
public void checkCreateNew(Void param)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<CustomOperationDTO,CustomOperation,CustomOperationData,Void>
-
doHasViewAccess
public boolean doHasViewAccess(CustomOperation 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<CustomOperationDTO,CustomOperation,CustomOperationData,Void>
-
getConfirmationPasswordInputForRun
public PasswordInputDTO getConfirmationPasswordInputForRun(RunCustomOperationDataParams params)
Description copied from interface:CustomOperationServiceReturns thePasswordInputDTOfor the confirmation password that would be required if executing the given custom operation.- Specified by:
getConfirmationPasswordInputForRunin interfaceCustomOperationService
-
getRunData
public RunCustomOperationData getRunData(RunCustomOperationDataParams params) throws FrameworkException
Description copied from interface:CustomOperationServiceReturns data to run a custom operation. Depending on the custom operation scope, the input parameters must be a subclass ofRunCustomOperationDataParamswith the specific parmeters set (for example, aRunRecordCustomOperationDataParamswith the record set if the scope isCustomOperationScope.RECORD) The result will also be a subclass ofRunCustomOperationDatadepending on the custom operation scope, for example aRunRecordCustomOperationData.- Specified by:
getRunDatain interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForAd
public List<RunnableCustomOperationVO> getRunnableOperationsForAd(BasicAdVO ad) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the user custom operations scope =CustomOperationScope.ADVERTISEMENTthe logged user can run over the given advertisement- Specified by:
getRunnableOperationsForAdin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForContact
public List<RunnableCustomOperationVO> getRunnableOperationsForContact(ContactVO contact) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the user custom operations scope =CustomOperationScope.CONTACTthe logged user can run over the given contact- Specified by:
getRunnableOperationsForContactin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForContactInfo
public List<RunnableCustomOperationVO> getRunnableOperationsForContactInfo(ContactInfoVO contactInfo) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the user custom operations scope =CustomOperationScope.CONTACT_INFOthe logged user can run over the given additional contact information- Specified by:
getRunnableOperationsForContactInfoin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForRecord
public List<RunnableCustomOperationVO> getRunnableOperationsForRecord(RecordVO record) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the user custom operations scope =CustomOperationScope.RECORDthe logged user can run over the given record- Specified by:
getRunnableOperationsForRecordin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForSystem
public List<RunnableCustomOperationVO> getRunnableOperationsForSystem() throws FrameworkException
Description copied from interface:CustomOperationServiceLists the custom operations with scope =CustomOperationScope.SYSTEMthe logged user can run- Specified by:
getRunnableOperationsForSystemin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForTransfer
public List<RunnableCustomOperationVO> getRunnableOperationsForTransfer(TransferVO transfer) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the custom operations with scope =CustomOperationScope.TRANSFERthe logged user can run over the given transfer- Specified by:
getRunnableOperationsForTransferin interfaceCustomOperationService- Throws:
FrameworkException
-
getRunnableOperationsForUser
public List<RunnableCustomOperationVO> getRunnableOperationsForUser(UserLocatorVO locator) throws FrameworkException
Description copied from interface:CustomOperationServiceLists the user custom operations scope =CustomOperationScope.USERthe logged user can run over the given user (or self if null)- Specified by:
getRunnableOperationsForUserin interfaceCustomOperationService- Throws:
FrameworkException
-
list
public List<CustomOperationResultVO> list() throws FrameworkException
Description copied from interface:CustomOperationServiceLists all available custom operations- Specified by:
listin interfaceCustomOperationService- Throws:
FrameworkException
-
run
public RunCustomOperationResult run(RunCustomOperationDTO params) throws FrameworkException
Description copied from interface:CustomOperationServiceRuns a custom operation, returning the result with all type information- Specified by:
runin interfaceCustomOperationService- Throws:
FrameworkException
-
runExternalRedirectCallback
public RunCustomOperationResult runExternalRedirectCallback(RunExternalRedirectCallbackParams params) throws FrameworkException
Description copied from interface:CustomOperationServiceRuns the callback for a custom operation of type external redirect. The result is currently always sent with result type =CustomOperationResultType.NOTIFICATION.- Specified by:
runExternalRedirectCallbackin interfaceCustomOperationService- Throws:
FrameworkException
-
saveOrder
public void saveOrder(List<Long> ids)
Description copied from interface:CustomOperationServiceSaves the order according to the given operation ids- Specified by:
saveOrderin interfaceCustomOperationService
-
checkRun
protected CustomOperation checkRun(CustomOperationVO customOperationVO, SimpleEntity entity)
-
doHasManageAccess
protected boolean doHasManageAccess(CustomOperation 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<CustomOperationDTO,CustomOperation,CustomOperationData,Void>
-
getImplementation
protected CRUDServiceLocal<CustomOperation,CustomOperationDTO,CustomOperationData,Void> getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<CustomOperationDTO,CustomOperation,CustomOperationData,Void>
-
-