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 |
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.
|
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 |
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 |
isGuest()
Returns whether the current session represents a guest
|
boolean |
isLoggedIn()
Returns whether the current session represents an 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 |
isScript()
Returns whether this session is running under a script
|
boolean |
isSystem()
Returns whether the current session represents a system task
|
boolean |
isVisible(org.cyclos.impl.access.EntityCheck<BaseEntity> entityCheck,
BaseEntity 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, getLoggedUser, getNetwork, getProducts, getRawEntityManagerHandler, getRemoteAddress, getRequestData, getSession, isAliasOperator, isGlobalAdminInNetwork, isManagerOf, isRestrictedOperator, isUserManager, resolveNetworkId, 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 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 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 isGuest()
SessionDataisGuest in interface SessionDataisGuest in class AbstractSessionDatapublic boolean isLoggedIn()
SessionDataisLoggedIn in interface SessionDataisLoggedIn 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 isScript()
SessionDataisScript in interface SessionDataisScript in class AbstractSessionDatapublic boolean isSystem()
SessionDataisSystem in interface SessionDataisSystem in class AbstractSessionDatapublic boolean isVisible(org.cyclos.impl.access.EntityCheck<BaseEntity> entityCheck, BaseEntity 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 AbstractSessionData