Class DocumentServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
- org.cyclos.security.contentmanagement.DocumentServiceSecurity
-
- All Implemented Interfaces:
DocumentService,CRUDService<DocumentDTO,DocumentData,DocumentDataParams>,CRUDWithConfirmationPasswordService<DocumentDTO,DocumentData,DocumentDataParams>,Service
@Security public class DocumentServiceSecurity extends CRUDServiceSecurity<DocumentDTO,Document,DocumentData,DocumentDataParams> implements DocumentService
Security layer forDocumentService
-
-
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 DocumentServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanPerformOperation(Document entity, CRUDOperation operation)Returns whether the logged user can perform the given operation over the given entityprotected voidcheckCreateNew(DocumentDataParams params)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notbooleandoHasManageAccess(Document document)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(Document document)Should be implemented in order to return whether the caller is allowed to view the given entity.DocumentVOgetDocument(DocumentVO documentVO)Used to get the view only object of the documentRawFileVOgetDocumentFile(DocumentVO documentVO)Return the file vo for a given documentDocumentSearchDatagetDocumentSearchData(UserLocatorVO locator)Returns data used to search documents, either over the given user or general documentsprotected DocumentServiceLocalgetImplementation()Should be implemented in order to return the actual implementation of the serviceProcessDynamicDocumentDatagetProcessDynamicDocumentData(DocumentVO documentVO, UserLocatorVO locator)Returns data used to fill a dynamic document based on the given user locator databooleanisAccessible(SessionData sessionData, Document entity)Must be implemented in order to determine whether the given entity is accessible for the given session data.List<DocumentVO>listUserDocuments(UserLocatorVO locator)List all documents enabled for the given userStringprocessDynamicDocument(ProcessDynamicDocumentDTO params)Processes the given document using the given user and custom field valuesSerializableInputStreamreadContent(DocumentVO documentVO)Reads the contents of the documentvoidsaveFile(DocumentVO documentVO, String contentType, String fileName, SerializableInputStream contents)Saves the given document, returning the generated identifierLongsaveWithFile(DocumentDTO document, String contentType, String fileName, SerializableInputStream contents)Saves the given document and filePage<DocumentVO>search(DocumentQuery query)List all documents filtered by category-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
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
-
canPerformOperation
public boolean canPerformOperation(Document entity, CRUDOperation operation)
Description copied from class:CRUDServiceSecurityReturns whether the logged user can perform the given operation over the given entity- Overrides:
canPerformOperationin classCRUDServiceSecurity<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
doHasManageAccess
public boolean doHasManageAccess(Document document)
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<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
doHasViewAccess
public boolean doHasViewAccess(Document document)
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<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
getDocument
public DocumentVO getDocument(DocumentVO documentVO)
Description copied from interface:DocumentServiceUsed to get the view only object of the document- Specified by:
getDocumentin interfaceDocumentService
-
getDocumentFile
public RawFileVO getDocumentFile(DocumentVO documentVO)
Description copied from interface:DocumentServiceReturn the file vo for a given document- Specified by:
getDocumentFilein interfaceDocumentService
-
getDocumentSearchData
public DocumentSearchData getDocumentSearchData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:DocumentServiceReturns data used to search documents, either over the given user or general documents- Specified by:
getDocumentSearchDatain interfaceDocumentService- Throws:
FrameworkException
-
getProcessDynamicDocumentData
public ProcessDynamicDocumentData getProcessDynamicDocumentData(DocumentVO documentVO, UserLocatorVO locator)
Description copied from interface:DocumentServiceReturns data used to fill a dynamic document based on the given user locator data- Specified by:
getProcessDynamicDocumentDatain interfaceDocumentService
-
isAccessible
public boolean isAccessible(SessionData sessionData, Document 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<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
listUserDocuments
public List<DocumentVO> listUserDocuments(UserLocatorVO locator)
Description copied from interface:DocumentServiceList all documents enabled for the given user- Specified by:
listUserDocumentsin interfaceDocumentService
-
processDynamicDocument
public String processDynamicDocument(ProcessDynamicDocumentDTO params) throws ValidationException
Description copied from interface:DocumentServiceProcesses the given document using the given user and custom field values- Specified by:
processDynamicDocumentin interfaceDocumentService- Throws:
ValidationException
-
readContent
public SerializableInputStream readContent(DocumentVO documentVO) throws EntityNotFoundException
Description copied from interface:DocumentServiceReads the contents of the document- Specified by:
readContentin interfaceDocumentService- Throws:
EntityNotFoundException- When the image is not found
-
saveFile
public void saveFile(DocumentVO documentVO, String contentType, String fileName, SerializableInputStream contents)
Description copied from interface:DocumentServiceSaves the given document, returning the generated identifier- Specified by:
saveFilein interfaceDocumentService
-
saveWithFile
public Long saveWithFile(DocumentDTO document, String contentType, String fileName, SerializableInputStream contents)
Description copied from interface:DocumentServiceSaves the given document and file- Specified by:
saveWithFilein interfaceDocumentService
-
search
public Page<DocumentVO> search(DocumentQuery query)
Description copied from interface:DocumentServiceList all documents filtered by category- Specified by:
searchin interfaceDocumentService
-
checkCreateNew
protected void checkCreateNew(DocumentDataParams params)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
getImplementation
protected DocumentServiceLocal getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<DocumentDTO,Document,DocumentData,DocumentDataParams>
-
-