Interface SessionData

    • Method Detail

      • getAccessChannel

        Channel getAccessChannel()
        Returns the original channel (i.e the channel used to access Cyclos) this session is using
      • getAccessChannelName

        String getAccessChannelName()
        Returns the internal name of the original channel (i.e the channel used to access Cyclos) . Must be accessible outside transactions.
      • getAccessibleBasicGroups

        Set<BasicGroup> getAccessibleBasicGroups()
        Returns the basic groups accessible by the current session
      • getAccessToken

        OidcAccessToken getAccessToken()
        Returns the OpenID Connect / OAuth2 access token for this session
      • getAuthenticatedUser

        UserAuthVO getAuthenticatedUser()
        Returns the user authentication data, or null if none
      • getChannel

        Channel getChannel()
        Returns the current channel this session is using
      • getChannelAccessAccessor

        ChannelAccessAccessor getChannelAccessAccessor()
        Returns the accessor for the access channel (i.e the original channel used to access Cyclos) access settings. Always uses the user's own settings. For example, if a global administrator is switched to a network, will get his settings, from global mode.
      • getChannelName

        String getChannelName()
        Returns the internal name of the current channel. Must be accessible outside transactions.
      • getChannelSettingsAccessor

        ChannelSettingsAccessor getChannelSettingsAccessor()
        Returns the accessor for the current channel (i.e the channel used to run the service method) general settings. Always uses the current configuration settings. For example, if a global administrator is switched to a network, will get the settings for the network administrators.
      • getGroup

        Group getGroup()
        Returns the group of the authenticated user, if any
      • getIdentityProvider

        IdentityProvider getIdentityProvider()
        Returns the IdentityProvider used for this session only if the user was authenticated using such mechanism.
      • getLoggedBasicUser

        BasicUser getLoggedBasicUser()
        Returns the authenticated basic user, or null if none
      • getLoggedOperator

        Operator getLoggedOperator()
        Returns the authenticated operator, or null if none or the logged is not an operator
      • getLoggedUser

        User getLoggedUser()
        Returns the authenticated user, or null if none
      • getNetwork

        Network getNetwork()
        Returns the network this session is using, or null if as global system or administrator
      • getPin

        Pin getPin()
        Returns the Pin used for this session only if the user was authenticated using such mechanism.
      • getRemoteAddress

        String getRemoteAddress()
        Returns the remote address, of the client accessing the application
      • getRequestData

        RequestData getRequestData()
        Returns data about the calling request. Must be accessible outside transactions.
      • getSession

        Session getSession()
        Returns the session in case this session data performed a login
      • hasPermission

        boolean hasPermission​(Permission permission)
        Returns whether the current user has the given permission
      • hasPermission

        default boolean hasPermission​(Permission... permissions)
        Returns whether the current user has any of the given the given permissions
      • hasRequiredValue

        boolean hasRequiredValue​(Permission permission,
                                 Object value)
        Returns whether the current user has access to the given required value for the given permission
      • isAdminOf

        boolean isAdminOf​(BasicUser user)
        Returns whether the current user is an administrator of the given user
      • isBrokerOf

        boolean isBrokerOf​(BasicUser user)
        Returns whether the current user is a broker of the given user
      • isGlobalAdminInNetwork

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

        boolean isGuest()
        Returns whether the current session represents a guest
      • isLoggedIn

        boolean isLoggedIn()
        Returns whether the current session represents a user
      • isManagerOf

        boolean isManagerOf​(BasicUser user)
        Returns whether the current user is a manager of the given user and is not the given user.
      • isMemberOnly

        boolean isMemberOnly()
        Returns true if the logged user has only Role member.
      • isMultiNetworkAdminInGlobalMode

        boolean isMultiNetworkAdminInGlobalMode()
        Returns whether a global restricted has not switched to a network.
      • isOwnerOf

        boolean isOwnerOf​(BasicUser operator)
        Returns whether current user is either the owner member of a given operator or as another alias operator
      • isRest

        default boolean isRest()
        Returns whether this session was initiated from a REST request
      • isScript

        boolean isScript()
        Returns whether this session is running under a script
      • isSelf

        boolean isSelf​(BasicUser user)
        Returns whether the current user is the same User as the given user's User.
      • isSystem

        boolean isSystem()
        Returns whether the current session represents a system task
      • isTrusted

        boolean isTrusted()
        Returns whether this session should be considered trusted
      • manages

        boolean manages​(BasicUser user)
        Returns whether the current user manages the given user. If the logged user and the given one are the same user then it returns true.
      • relatesTo

        boolean relatesTo​(BasicUser user)
        Returns whether the current user is related to (is allowed to view) the given user