Class AbstractNetworkedServerComponent

    • Constructor Detail

      • AbstractNetworkedServerComponent

        public AbstractNetworkedServerComponent()
    • Method Detail

      • canManage

        protected boolean canManage​(BasicUser user)
        Returns whether the logged user manages the given user
      • clearAlreadyValidated

        protected void clearAlreadyValidated​(Bean bean)
        Forces the given bean as being in the not already validated state
      • getLoggedBasicUser

        protected BasicUser getLoggedBasicUser()
        Returns the currently logged basic user, being a regular user or operator, or null when none
      • getLoggedUser

        protected User getLoggedUser()
        Returns the currently logged user, or the owner user when there's a logged operator, or null when none
      • getTranslatedName

        protected String getTranslatedName​(NamedEntity entity)
        Returns the translated name for the given entity, according to the current data translation setting
      • getTranslatedValue

        protected String getTranslatedValue​(BaseEntity entity,
                                            com.querydsl.core.types.dsl.StringPath property)
        Returns a translated property value for the given entity, according to the current data translation setting
      • hasPermission

        protected boolean hasPermission​(Permission... permissions)
        Checks whether the logged user has access to any of the specified permissions
      • hasValue

        protected boolean hasValue​(Permission permission,
                                   Object... values)
        Returns whether the logged user has access to ALL the given values for the given permission. If the permission is not related to values, returns false
      • inSameNetwork

        protected boolean inSameNetwork​(NetworkedEntity entity)
        Returns whether the given entity is defined on the same network as the current session, or global if the current session is global. If running as system, always returns true.
      • inSameNetworkOrGlobal

        protected boolean inSameNetworkOrGlobal​(NetworkedEntity entity)
        Returns whether the given entity is global (network is null) or is defined on the same network as the current session, or global if the current session is global. If running as system, always returns true.
      • isAdmin

        protected boolean isAdmin()
        Checks whether there's a logged admin
      • isAlreadyValidated

        protected boolean isAlreadyValidated​(Bean bean)
        Returns whether the given bean was marked as already validated in this request
      • isBroker

        protected boolean isBroker()
        Checks whether there's a logged broker
      • isGlobalAdmin

        protected boolean isGlobalAdmin()
        Returns whether there's a logged global admin
      • isGlobalAdminInNetwork

        protected boolean isGlobalAdminInNetwork()
        Returns whether a global admin OR a global restricted has switched to a network.
      • isGuest

        protected boolean isGuest()
        Checks whether there's no one logged in, and is a public access
      • isLoggedIn

        protected boolean isLoggedIn()
        Checks whether there's a logged user, no matter the user type
      • isMember

        protected boolean isMember()
        Checks whether there's a logged member
      • isMemberOnly

        protected boolean isMemberOnly()
        Checks whether there's a logged member only (i.e just member, not broker nor operator)
      • isNetworkAdmin

        protected boolean isNetworkAdmin()
        Returns whether there's a logged network admin
      • isOperator

        protected boolean isOperator()
        Checks whether there's a logged operator
      • isRelatedToUser

        protected boolean isRelatedToUser​(BasicUser user)
        Returns whether the logged user is related to the given user
      • isSystem

        protected boolean isSystem()
        Checks whether the current thread is running from a system task
      • isUserManager

        protected boolean isUserManager()
        Returns whether the logged user is a user manager (admin or broker)
      • isUserManagerOf

        protected boolean isUserManagerOf​(BasicUser user)
        Returns true if the logged user is a user manager of the given user. Note: A user cannot be a user manager of itself.
      • permissionOptionalValue

        protected UserPermissionCheck permissionOptionalValue​(User user)
        See Also:
        AuthHandler#permissionOptionalValue(User)
      • setAlreadyValidated

        protected void setAlreadyValidated​(Bean bean,
                                           boolean alreadyValidated)
      • toDate

        protected Date toDate​(DateTime dateTime)
        Converts a DateTime representing a date in the logged user's time zone to a Date delegating to the conversion handler.
      • toDateTime

        protected DateTime toDateTime​(Date date)
        Converts a Date to a DateTime using the logged user's time zone delegating to the conversion handler.
      • validate

        protected void validate​(Validator validator,
                                Object object)
        Invokes the Validator#validate(TranslationMessageServiceLocal, ConversionHandler, EntityManager, Object) method with the current context