public class ScriptSessionData extends AbstractSessionData
SessionData preserving the logged user. If it must run as system then it has all permissions
and it's related to all users
(like system does). Otherwise it behaves as the wrapped session.requestData| Constructor and Description |
|---|
ScriptSessionData(SessionData delegate,
boolean runAsSystem) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkConsistency()
Checks for consistency.
|
protected java.lang.Long |
doGetConfigurationId() |
protected org.cyclos.impl.users.ProductsAccessor |
doGetProducts()
Must be implemented to return a a valid
ProductsAccessor |
protected org.cyclos.impl.access.SessionDataSubjectId |
doGetSubjectId() |
AccessClient |
getAccessClient()
Return the current access client only if
SessionData.getPrincipalType() return an instance of
AccessClientPrincipalType. |
java.util.Collection<BasicGroup> |
getAccessibleBasicGroups()
Returns the basic groups accessible by the current session
|
UserAuthVO |
getAuthenticatedUser()
Returns the user authentication data, or null if none
|
ChannelConfiguration |
getChannelConfiguration()
Returns the channel configuration accessor
|
java.lang.String |
getChannelName()
Returns the internal name of the current channel.
|
SessionData |
getDelegate() |
Group |
getGroup()
Returns the group of the authenticated user, if any
|
BasicUser |
getLoggedBasicUser()
Returns the authenticated basic user, or null if none
|
java.lang.String |
getPrincipal()
Returns the principal used to access this session, if any
|
PrincipalType |
getPrincipalType()
Returns the principal type used for the current session.
|
java.lang.String |
getRemoteAddress()
Returns the remote address, of the client accessing the application
|
Session |
getSession()
Returns the session in case this session data performed a login
|
org.cyclos.impl.access.SessionDataSubjectId |
getSubjectId()
Returns the subject id
|
Token |
getToken()
Return the current token only if
SessionData.getPrincipalType() return an instance of TokenPrincipalType. |
boolean |
hasPermission(Permission permission)
Returns whether the current user has the given permission
|
boolean |
hasRequiredValue(Permission permission,
java.lang.Object value)
Returns whether the current user has access to the given required value for the given permission
|
boolean |
isAdmin()
Returns whether the
Role.ADMIN is granted |
boolean |
isAdminOf(BasicUser user)
Returns whether the current user is an administrator of the given user
|
boolean |
isAliasOperator()
Returns whether the
Role.ALIAS_OPERATOR is granted |
boolean |
isBroker()
Returns whether the
Role.BROKER is granted |
boolean |
isBrokerOf(BasicUser user)
Returns whether the current user is a broker of the given user
|
boolean |
isGlobalAdmin()
Returns whether the
Role.GLOBAL_ADMIN is granted |
boolean |
isGlobalAdminInNetwork()
Returns whether a global admin OR a global restricted has switched to a network.
|
boolean |
isGuest()
Returns whether the current session represents a guest
|
boolean |
isLoggedIn()
Returns whether the current session represents a user
|
boolean |
isManagerOf(BasicUser user)
Returns whether the current user is a manager of the given user and is not the given user.
|
boolean |
isMember()
Returns whether the
Role.MEMBER is granted |
boolean |
isMemberOnly()
Returns true if the logged user has only
Role member. |
boolean |
isNetworkAdmin()
Returns whether the
Role.NETWORK_ADMIN is granted |
boolean |
isOperator()
Returns whether the
Role.OPERATOR is granted |
boolean |
isOwnerOf(BasicUser operator)
Returns whether current user is either the owner member of a given operator or as another alias operator
|
boolean |
isRestrictedOperator()
Returns whether the
Role.RESTRICTED_OPERATOR is granted |
boolean |
isScript()
Returns whether this session is running under a script
|
boolean |
isSystem()
Returns whether the current session represents a system task
|
boolean |
isUserManager()
Returns whether the
Role.ADMIN or Role.BROKER roles are granted |
boolean |
isVisible(org.cyclos.impl.access.EntityCheck<SimpleEntity> entityCheck,
SimpleEntity entity)
Returns whether the given entity is visible under the given entity check
|
boolean |
manages(BasicUser user)
Returns whether the current user manages the given user.
|
boolean |
relatesTo(BasicUser user)
Returns whether the current user is related to (is allowed to view) the given user
|
bean, doGetConfigurationAccessor, doGetPreferredLocales, getApplicationContext, getChannel, getConfiguration, getConfigurationEntity, getLoggedOperator, getLoggedUser, getNetwork, getProducts, getRawEntityManagerHandler, getRequestData, resolveNetworkId, runAsSystem, runAsSystempublic ScriptSessionData(SessionData delegate, boolean runAsSystem)
public void checkConsistency()
throws InvalidSessionDataException
SessionDatacheckConsistency in interface SessionDatacheckConsistency in class AbstractSessionDataInvalidSessionDataExceptionpublic AccessClient getAccessClient()
SessionDataSessionData.getPrincipalType() return an instance of
AccessClientPrincipalType. Otherwise it
returns null.public java.util.Collection<BasicGroup> getAccessibleBasicGroups()
SessionDatapublic UserAuthVO getAuthenticatedUser()
SessionDatapublic ChannelConfiguration getChannelConfiguration()
SessionDatapublic java.lang.String getChannelName()
SessionDatapublic SessionData getDelegate()
public Group getGroup()
SessionDatapublic BasicUser getLoggedBasicUser()
SessionDatapublic java.lang.String getPrincipal()
SessionDatagetPrincipal in interface SessionDatagetPrincipal in class AbstractSessionDatapublic PrincipalType getPrincipalType()
SessionDatagetPrincipalType in interface SessionDatagetPrincipalType in class AbstractSessionDatapublic java.lang.String getRemoteAddress()
SessionDatagetRemoteAddress in interface SessionDatagetRemoteAddress in class AbstractSessionDatapublic Session getSession()
SessionDatagetSession in interface SessionDatagetSession in class AbstractSessionDatapublic org.cyclos.impl.access.SessionDataSubjectId getSubjectId()
SessionDatagetSubjectId in interface SessionDatagetSubjectId in class AbstractSessionDatapublic Token getToken()
SessionDataSessionData.getPrincipalType() return an instance of TokenPrincipalType.
Otherwise it returns null.public boolean hasPermission(Permission permission)
SessionDatapublic boolean hasRequiredValue(Permission permission, java.lang.Object value)
SessionDatapublic boolean isAdmin()
RoleContainerRole.ADMIN is grantedisAdmin in interface RoleContainerisAdmin in class AbstractSessionDatapublic boolean isAdminOf(BasicUser user)
SessionDataisAdminOf in interface SessionDataisAdminOf in class AbstractSessionDatapublic boolean isAliasOperator()
RoleContainerRole.ALIAS_OPERATOR is grantedisAliasOperator in interface RoleContainerisAliasOperator in class AbstractSessionDatapublic boolean isBroker()
RoleContainerRole.BROKER is grantedisBroker in interface RoleContainerisBroker in class AbstractSessionDatapublic boolean isBrokerOf(BasicUser user)
SessionDataisBrokerOf in interface SessionDataisBrokerOf in class AbstractSessionDatapublic boolean isGlobalAdmin()
RoleContainerRole.GLOBAL_ADMIN is grantedisGlobalAdmin in interface RoleContainerisGlobalAdmin in class AbstractSessionDatapublic boolean isGlobalAdminInNetwork()
AbstractSessionDataisGlobalAdminInNetwork in interface SessionDataisGlobalAdminInNetwork in class AbstractSessionDatapublic boolean isGuest()
SessionDataisGuest in interface SessionDataisGuest in class AbstractSessionDatapublic boolean isLoggedIn()
SessionDataisLoggedIn in interface SessionDataisLoggedIn in class AbstractSessionDatapublic boolean isManagerOf(BasicUser user)
SessionDataisManagerOf in interface SessionDataisManagerOf in class AbstractSessionDatapublic boolean isMember()
RoleContainerRole.MEMBER is grantedisMember in interface RoleContainerisMember in class AbstractSessionDatapublic boolean isMemberOnly()
SessionDataRole member.isMemberOnly in interface SessionDataisMemberOnly in class AbstractSessionDatapublic boolean isNetworkAdmin()
RoleContainerRole.NETWORK_ADMIN is grantedisNetworkAdmin in interface RoleContainerisNetworkAdmin in class AbstractSessionDatapublic boolean isOperator()
RoleContainerRole.OPERATOR is grantedisOperator in interface RoleContainerisOperator in class AbstractSessionDatapublic boolean isOwnerOf(BasicUser operator)
SessionDataisOwnerOf in interface SessionDataisOwnerOf in class AbstractSessionDatapublic boolean isRestrictedOperator()
RoleContainerRole.RESTRICTED_OPERATOR is grantedisRestrictedOperator in interface RoleContainerisRestrictedOperator in class AbstractSessionDatapublic boolean isScript()
SessionDataisScript in interface SessionDataisScript in class AbstractSessionDatapublic boolean isSystem()
SessionDataisSystem in interface SessionDataisSystem in class AbstractSessionDatapublic boolean isUserManager()
RoleContainerRole.ADMIN or Role.BROKER roles are grantedisUserManager in interface RoleContainerisUserManager in class AbstractSessionDatapublic boolean isVisible(org.cyclos.impl.access.EntityCheck<SimpleEntity> entityCheck, SimpleEntity entity)
SessionDatapublic boolean manages(BasicUser user)
SessionDatapublic boolean relatesTo(BasicUser user)
SessionDataprotected java.lang.Long doGetConfigurationId()
doGetConfigurationId in class AbstractSessionDataprotected org.cyclos.impl.users.ProductsAccessor doGetProducts()
AbstractSessionDataProductsAccessordoGetProducts in class AbstractSessionDataprotected org.cyclos.impl.access.SessionDataSubjectId doGetSubjectId()
doGetSubjectId in class AbstractSessionData