Package org.cyclos.security.system
Class BaseSimpleCustomFieldServiceSecurity<DTO extends CustomFieldDTO,CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,D extends CustomFieldData<DTO>,DP>
- 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<DTO,CF,D,DP>
-
- org.cyclos.security.system.BaseCustomFieldServiceSecurity<DTO,CF,C,PV,D,DP>
-
- org.cyclos.security.system.BaseSimpleCustomFieldServiceSecurity<DTO,CF,C,PV,D,DP>
-
- All Implemented Interfaces:
CRUDService<DTO,D,DP>,CRUDWithConfirmationPasswordService<DTO,D,DP>,Service,BaseCustomFieldService<DTO,D,DP>
- Direct Known Subclasses:
AdCustomFieldServiceSecurity,ContactCustomFieldServiceSecurity,ContactInfoFieldServiceSecurity,RecordCustomFieldServiceSecurity,TransactionCustomFieldServiceSecurity,UserCustomFieldServiceSecurity,VoucherCustomFieldServiceSecurity
public abstract class BaseSimpleCustomFieldServiceSecurity<DTO extends CustomFieldDTO,CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,D extends CustomFieldData<DTO>,DP> extends BaseCustomFieldServiceSecurity<DTO,CF,C,PV,D,DP>
Base class for security layers for custom fields which use a simple permission for view and another one for manage as the only checks
-
-
Field Summary
Fields Modifier and Type Field Description protected PermissionmanagePermissionprotected PermissionviewPermission-
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 BaseSimpleCustomFieldServiceSecurity(Class<CF> entityClass, Permission viewPermission, Permission managePermission)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckCreateNew(DP params)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notprotected voidcheckManagePermission()Checks whether the caller has the manage permission grantedprotected voidcheckViewPermission()Checks whether the caller has the view permission grantedbooleandoHasManageAccess(CF entity)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(CF entity)Should be implemented in order to return whether the caller is allowed to view the given entity.protected booleanhasManagePermission()Returns whether the caller has the manage permission grantedprotected booleanhasViewPermission()Returns whether the caller has the view permission granted-
Methods inherited from class org.cyclos.security.system.BaseCustomFieldServiceSecurity
saveOrder
-
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, getImplementation, 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
-
-
-
-
Field Detail
-
viewPermission
protected final Permission viewPermission
-
managePermission
protected final Permission managePermission
-
-
Constructor Detail
-
BaseSimpleCustomFieldServiceSecurity
public BaseSimpleCustomFieldServiceSecurity(Class<CF> entityClass, Permission viewPermission, Permission managePermission)
-
-
Method Detail
-
doHasManageAccess
public final boolean doHasManageAccess(CF 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<DTO extends CustomFieldDTO,CF extends CustomField<CF,C,PV>,D extends CustomFieldData<DTO>,DP>
-
doHasViewAccess
public final boolean doHasViewAccess(CF 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<DTO extends CustomFieldDTO,CF extends CustomField<CF,C,PV>,D extends CustomFieldData<DTO>,DP>
-
checkCreateNew
protected final void checkCreateNew(DP params)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<DTO extends CustomFieldDTO,CF extends CustomField<CF,C,PV>,D extends CustomFieldData<DTO>,DP>
-
checkManagePermission
protected final void checkManagePermission() throws PermissionDeniedExceptionChecks whether the caller has the manage permission granted- Throws:
PermissionDeniedException
-
checkViewPermission
protected final void checkViewPermission() throws PermissionDeniedExceptionChecks whether the caller has the view permission granted- Throws:
PermissionDeniedException
-
hasManagePermission
protected final boolean hasManagePermission()
Returns whether the caller has the manage permission granted
-
hasViewPermission
protected final boolean hasViewPermission()
Returns whether the caller has the view permission granted
-
-