Package org.cyclos.security.users
Class OperatorServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
- org.cyclos.security.users.OperatorServiceSecurity
-
- All Implemented Interfaces:
CRUDService<OperatorDTO,OperatorData,OperatorDataParams>,CRUDWithConfirmationPasswordService<OperatorDTO,OperatorData,OperatorDataParams>,Service,OperatorService
@Security public class OperatorServiceSecurity extends CRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams> implements OperatorService
Security layer forOperatorService
-
-
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 OperatorServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanManageOperators(User user)booleancanPerformOperation(Operator operator, CRUDOperation operation)Returns whether the logged user can perform the given operation over the given entitybooleancanViewOperators(User user)protected voidcheckCreateNew(OperatorDataParams params)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notprotected booleandoHasManageAccess(Operator operator)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(Operator operator)Should be implemented in order to return whether the caller is allowed to view the given entity.protected CRUDServiceLocal<Operator,OperatorDTO,OperatorData,OperatorDataParams>getImplementation()Should be implemented in order to return the actual implementation of the serviceOperatorsSearchDatagetSearchData(UserLocatorVO locator)Returns data for searching operators of the given userViewOperatorProfileDatagetViewProfileData(UserLocatorVO locator)Returns data for viewing an operator profilebooleanisAccessible(SessionData sessionData, Operator operator)Must be implemented in order to determine whether the given entity is accessible for the given session data.protected voidonBeforeSave(OperatorDTO dto, Operator operator)UserRegistrationResultregister(OperatorRegistrationDTO dto)Registers an operator, returning the status and generated dataPage<OperatorWithFieldsVO>search(OperatorQuery params)Searches for operators according to the given criteria-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, customizeData, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, 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
-
Methods inherited from interface org.cyclos.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
-
-
-
Method Detail
-
canManageOperators
public boolean canManageOperators(User user)
-
canPerformOperation
public boolean canPerformOperation(Operator operator, CRUDOperation operation)
Description copied from class:CRUDServiceSecurityReturns whether the logged user can perform the given operation over the given entity- Overrides:
canPerformOperationin classCRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
canViewOperators
public boolean canViewOperators(User user)
-
doHasViewAccess
public boolean doHasViewAccess(Operator operator)
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<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
getSearchData
public OperatorsSearchData getSearchData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:OperatorServiceReturns data for searching operators of the given user- Specified by:
getSearchDatain interfaceOperatorService- Throws:
FrameworkException
-
getViewProfileData
public ViewOperatorProfileData getViewProfileData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:OperatorServiceReturns data for viewing an operator profile- Specified by:
getViewProfileDatain interfaceOperatorService- Throws:
FrameworkException
-
isAccessible
public boolean isAccessible(SessionData sessionData, Operator operator)
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<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
register
public UserRegistrationResult register(OperatorRegistrationDTO dto) throws FrameworkException
Description copied from interface:OperatorServiceRegisters an operator, returning the status and generated data- Specified by:
registerin interfaceOperatorService- Throws:
FrameworkException
-
search
public Page<OperatorWithFieldsVO> search(OperatorQuery params) throws FrameworkException
Description copied from interface:OperatorServiceSearches for operators according to the given criteria- Specified by:
searchin interfaceOperatorService- Throws:
FrameworkException
-
checkCreateNew
protected void checkCreateNew(OperatorDataParams params)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
doHasManageAccess
protected boolean doHasManageAccess(Operator operator)
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<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
getImplementation
protected CRUDServiceLocal<Operator,OperatorDTO,OperatorData,OperatorDataParams> getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
onBeforeSave
protected void onBeforeSave(OperatorDTO dto, Operator operator)
- Overrides:
onBeforeSavein classCRUDServiceSecurity<OperatorDTO,Operator,OperatorData,OperatorDataParams>
-
-