Package org.cyclos.security
Class BaseServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- Direct Known Subclasses:
AccountFeeLogServiceSecurity,AccountServiceSecurity,AdQuestionServiceSecurity,AdWebShopSettingServiceSecurity,AgreementLogServiceSecurity,AlertServiceSecurity,BaseImageServiceSecurity,BrokeringServiceSecurity,CaptchaServiceSecurity,ChargebackServiceSecurity,ConnectedUserServiceSecurity,CRUDServiceSecurity,DataTranslationServiceSecurity,DeviceConfirmationServiceSecurity,EasyInvoiceServiceSecurity,EntityLogServiceSecurity,ErrorLogServiceSecurity,ExternalPaymentServiceSecurity,FcmTokenServiceSecurity,InitializationServiceSecurity,InternalAuthServiceSecurity,InternalBasicUserServiceSecurity,InternalFrontendServiceSecurity,InternalIdentityProviderServiceSecurity,InternalImageServiceSecurity,InternalMobileServiceSecurity,InternalOrderServiceSecurity,InternalTranslationMessageServiceSecurity,InternalUiServiceSecurity,InviteServiceSecurity,LicenseServiceSecurity,LocalizationServiceSecurity,LoginServiceSecurity,MessageServiceSecurity,NotificationServiceSecurity,NotificationSettingsServiceSecurity,OidcAuthorizationServiceSecurity,OidcServiceSecurity,PasswordServiceSecurity,PaymentRequestServiceSecurity,PaymentServiceSecurity,PinServiceSecurity,PrivacySettingsServiceSecurity,ProductsGroupServiceSecurity,ProductsUserServiceSecurity,RawFileServiceSecurity,RecurringPaymentServiceSecurity,ReportServiceSecurity,ScheduledPaymentServiceSecurity,SetupServiceSecurity,SitemapServiceSecurity,SmsServiceSecurity,SystemMonitorServiceSecurity,TicketServiceSecurity,TransactionAuthorizationServiceSecurity,TransactionServiceSecurity,TransferServiceSecurity,TranslationMessageServiceSecurity,TrustedDeviceServiceSecurity,UserAccountFeeLogServiceSecurity,UserAccountVisibilitySettingsServiceSecurity,UserChannelServiceSecurity,UserDashboardActionServiceSecurity,UserFrontendSettingsServiceSecurity,UserGroupServiceSecurity,UserIdentityProviderServiceSecurity,UserRegionalSettingsServiceSecurity,UserStatusServiceSecurity,UserValidationServiceSecurity,VoucherServiceSecurity
public abstract class BaseServiceSecurity extends AbstractNetworkedServerComponent
Common class which should be extended by all service security classes
-
-
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 BaseServiceSecurity()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckGuest()Makes sure that a guest is invoking the methodprotected voidcheckId(Class<? extends SimpleEntity> entityType, Long id)Makes sure that the entity with the given id is valid, ignoring if id is nullprotected voidcheckIds(Class<? extends SimpleEntity> entityType, Collection<Long> ids)Makes sure that all entities with the given ids are valid, ignoring nulls / empty collectionsprotected voidcheckInternalName(Class<? extends SimpleEntity> entityType, String internalName)Makes sure that the entity with the given internal name is valid, ignoring if internal name is nullprotected voidcheckLoggedIn()Makes sure that a logged user is invoking the methodprotected BasicUsercheckManagesUser(IUser user)protected BasicUsercheckRelatesToUser(IUser user)protected OidcAccessTokencheckScope(Scope... scopes)Checks that, if authenticated via OAuth, at least one of the given scopes are granted.protected voidcheckVO(Class<? extends SimpleEntity> entityType, EntityVO vo)Makes sure that the given vo is valid, either attempting to load the entity by id or internal nameprotected voidcheckVOs(Class<? extends SimpleEntity> entityType, Collection<? extends EntityVO> vos)Makes sure that all entities with the given ids are valid, ignoring nulls / empty collectionsprotected voiddoInitialize()protected EntityCheckRegistrygetEntityCheckRegistry()protected BasicUsergetUser(IUser user)voidinitialize()protected abstract EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if none-
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
-
initialize
@PostConstruct public final void initialize()
-
checkGuest
protected void checkGuest()
Makes sure that a guest is invoking the method
-
checkId
protected void checkId(Class<? extends SimpleEntity> entityType, Long id)
Makes sure that the entity with the given id is valid, ignoring if id is null
-
checkIds
protected void checkIds(Class<? extends SimpleEntity> entityType, Collection<Long> ids)
Makes sure that all entities with the given ids are valid, ignoring nulls / empty collections
-
checkInternalName
protected void checkInternalName(Class<? extends SimpleEntity> entityType, String internalName)
Makes sure that the entity with the given internal name is valid, ignoring if internal name is null
-
checkLoggedIn
protected void checkLoggedIn()
Makes sure that a logged user is invoking the method
-
checkScope
protected OidcAccessToken checkScope(Scope... scopes)
Checks that, if authenticated via OAuth, at least one of the given scopes are granted. No-op when not authenticated with an access token.
-
checkVO
protected void checkVO(Class<? extends SimpleEntity> entityType, EntityVO vo)
Makes sure that the given vo is valid, either attempting to load the entity by id or internal name
-
checkVOs
protected void checkVOs(Class<? extends SimpleEntity> entityType, Collection<? extends EntityVO> vos)
Makes sure that all entities with the given ids are valid, ignoring nulls / empty collections
-
doInitialize
protected void doInitialize()
-
getEntityCheckRegistry
protected EntityCheckRegistry getEntityCheckRegistry()
-
resolveEntityCheck
protected abstract EntityCheck<?> resolveEntityCheck()
Must be implemented in order to return theEntityCheckmanaged by this security component, or null if none
-
-