Package org.cyclos.security.system
Class RawFileServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.system.RawFileServiceSecurity
-
- All Implemented Interfaces:
Service,RawFileService
@Security public class RawFileServiceSecurity extends BaseServiceSecurity implements RawFileService
Security layer forRawFileService
-
-
Field Summary
-
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 RawFileServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPermissionForNewTemp(CustomField<?,?,?> customField)booleanhasManagePermission(RawFile file)booleanhasViewPermission(RawFile file)List<RawFileVO>listTemp(String guestKey, CustomFieldVO customFieldVO)Lists the temporary files owned by the current user or guest.RawFileVOload(Long id)Loads a vo by idSerializableInputStreamreadContent(Long id)Reads the contents of the given filevoidremove(Long id)Removes the given filevoidremoveAll(List<Long> ids)Removes the files with the given idsprotected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonevoidsaveName(Long id, String name)Saves the name of the given fileRawFileVOsaveTemp(String guestKey, CustomFieldVO customFieldVO, String name, String contentType, SerializableInputStream content)Saves the given file content.-
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
-
-
-
-
Method Detail
-
checkPermissionForNewTemp
public void checkPermissionForNewTemp(CustomField<?,?,?> customField)
-
hasManagePermission
public boolean hasManagePermission(RawFile file)
-
hasViewPermission
public boolean hasViewPermission(RawFile file)
-
listTemp
public List<RawFileVO> listTemp(String guestKey, CustomFieldVO customFieldVO) throws FrameworkException
Description copied from interface:RawFileServiceLists the temporary files owned by the current user or guest. Guests are matched by guest key or remote address if none is given- Specified by:
listTempin interfaceRawFileService- Throws:
FrameworkException
-
load
public RawFileVO load(Long id) throws FrameworkException
Description copied from interface:RawFileServiceLoads a vo by id- Specified by:
loadin interfaceRawFileService- Throws:
FrameworkException
-
readContent
public SerializableInputStream readContent(Long id) throws FrameworkException
Description copied from interface:RawFileServiceReads the contents of the given file- Specified by:
readContentin interfaceRawFileService- Throws:
FrameworkException
-
remove
public void remove(Long id) throws FrameworkException
Description copied from interface:RawFileServiceRemoves the given file- Specified by:
removein interfaceRawFileService- Throws:
FrameworkException
-
removeAll
public void removeAll(List<Long> ids)
Description copied from interface:RawFileServiceRemoves the files with the given ids- Specified by:
removeAllin interfaceRawFileService
-
saveName
public void saveName(Long id, String name) throws FrameworkException
Description copied from interface:RawFileServiceSaves the name of the given file- Specified by:
saveNamein interfaceRawFileService- Throws:
FrameworkException
-
saveTemp
public RawFileVO saveTemp(String guestKey, CustomFieldVO customFieldVO, String name, String contentType, SerializableInputStream content) throws FrameworkException
Description copied from interface:RawFileServiceSaves the given file content. Temporary files are used forCustomFieldType.FILEcustom field then it must be specified through thecustomFieldVOparameter and it must contains also the nature to allow load the correct custom field sub-class.- Specified by:
saveTempin interfaceRawFileService- Throws:
FrameworkException
-
resolveEntityCheck
protected EntityCheck<?> resolveEntityCheck()
Description copied from class:BaseServiceSecurityMust be implemented in order to return theEntityCheckmanaged by this security component, or null if none- Specified by:
resolveEntityCheckin classBaseServiceSecurity
-
-