Package ome.security.basic
Class BasicEventContext
- java.lang.Object
-
- ome.system.SimpleEventContext
-
- ome.security.basic.BasicEventContext
-
- All Implemented Interfaces:
java.io.Serializable
,ome.system.EventContext
- Direct Known Subclasses:
BasicSecurityWiring.CloseOnNoSessionContext
public class BasicEventContext extends ome.system.SimpleEventContext
EventContext
implementation for use within the security system. Holds various other information needed for proper functioning of aThread
. Not-thread-safe. Intended to be held by aThreadLocal
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicEventContext(ome.system.Principal p, SessionStats stats)
BasicEventContext(ome.system.Principal p, SessionStats stats, ome.system.EventContext ec)
Copy-constructor to not have to allow the mutatorSimpleEventContext.copy(EventContext)
orcopyContext(EventContext)
out of theEventContext
hierarchy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ome.model.enums.AdminPrivilege>
getAdminPrivileges()
java.util.Map<java.lang.String,java.lang.String>
getCallContext()
java.util.Set<java.lang.String>
getDisabledSubsystems()
ome.model.meta.Event
getEvent()
ome.model.meta.ExperimenterGroup
getGroup()
java.util.List<java.lang.Long>
getLeaderOfGroupsList()
java.util.Set<ome.model.IObject>
getLockCandidates()
java.util.List<ome.model.meta.EventLog>
getLogs()
java.util.List<java.lang.Long>
getMemberOfGroupsList()
ome.model.meta.Experimenter
getOwner()
ome.model.internal.Permissions
getPermissionsForGroup(java.lang.Long group)
Never returnsPermissions.DUMMY
.ome.system.Principal
getPrincipal()
java.util.Set<RegisterServiceCleanupMessage>
getServiceCleanups()
SessionStats
getStats()
ome.model.meta.Experimenter
getSudoer()
void
loadPermissions(org.hibernate.Session session)
void
setAdmin(boolean admin)
void
setAdminPrivileges(java.util.Set<ome.model.enums.AdminPrivilege> adminPrivileges)
java.util.Map<java.lang.String,java.lang.String>
setCallContext(java.util.Map<java.lang.String,java.lang.String> ctx)
void
setDisabledSubsystems(java.util.Set<java.lang.String> disabledSubsystems)
void
setEvent(ome.model.meta.Event event)
void
setGroup(ome.model.meta.ExperimenterGroup group, ome.model.internal.Permissions p)
void
setLeaderOfGroups(java.util.List<java.lang.Long> groupIds)
void
setLockCandidates(java.util.Set<ome.model.IObject> lockCandidates)
void
setLogs(java.util.List<ome.model.meta.EventLog> logs)
void
setMemberOfGroups(java.util.List<java.lang.Long> groupIds)
void
setOwner(ome.model.meta.Experimenter owner)
ome.model.internal.Permissions
setPermissionsForGroup(java.lang.Long group, ome.model.internal.Permissions perms)
Called duringBasicACLVoter.allowLoad(org.hibernate.Session, Class, ome.model.internal.Details, long)
to track groups that will need resolving later.void
setReadOnly(boolean readOnly)
void
setServiceCleanups(java.util.Set<RegisterServiceCleanupMessage> serviceCleanups)
void
setShareId(java.lang.Long id)
void
setSudoer(ome.model.meta.Experimenter sudoer)
void
setUmask(ome.model.internal.Permissions umask)
java.lang.String
toString()
-
Methods inherited from class ome.system.SimpleEventContext
copy, getCurrentAdminPrivileges, getCurrentEventId, getCurrentEventType, getCurrentGroupId, getCurrentGroupName, getCurrentGroupPermissions, getCurrentSessionId, getCurrentSessionUuid, getCurrentShareId, getCurrentSudoerId, getCurrentSudoerName, getCurrentUmask, getCurrentUserId, getCurrentUserName, isCurrentUserAdmin, isReadOnly, setGroupPermissions
-
-
-
-
Constructor Detail
-
BasicEventContext
public BasicEventContext(ome.system.Principal p, SessionStats stats)
-
BasicEventContext
public BasicEventContext(ome.system.Principal p, SessionStats stats, ome.system.EventContext ec)
Copy-constructor to not have to allow the mutatorSimpleEventContext.copy(EventContext)
orcopyContext(EventContext)
out of theEventContext
hierarchy.
-
-
Method Detail
-
getCallContext
public java.util.Map<java.lang.String,java.lang.String> getCallContext()
-
setCallContext
public java.util.Map<java.lang.String,java.lang.String> setCallContext(java.util.Map<java.lang.String,java.lang.String> ctx)
-
setUmask
public void setUmask(ome.model.internal.Permissions umask)
-
setAdmin
public void setAdmin(boolean admin)
-
setAdminPrivileges
public void setAdminPrivileges(java.util.Set<ome.model.enums.AdminPrivilege> adminPrivileges)
-
getAdminPrivileges
public java.util.Set<ome.model.enums.AdminPrivilege> getAdminPrivileges()
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
setShareId
public void setShareId(java.lang.Long id)
-
getPrincipal
public ome.system.Principal getPrincipal()
-
getStats
public SessionStats getStats()
-
getEvent
public ome.model.meta.Event getEvent()
-
setEvent
public void setEvent(ome.model.meta.Event event)
-
getOwner
public ome.model.meta.Experimenter getOwner()
-
setOwner
public void setOwner(ome.model.meta.Experimenter owner)
-
getSudoer
public ome.model.meta.Experimenter getSudoer()
-
setSudoer
public void setSudoer(ome.model.meta.Experimenter sudoer)
-
getGroup
public ome.model.meta.ExperimenterGroup getGroup()
-
setGroup
public void setGroup(ome.model.meta.ExperimenterGroup group, ome.model.internal.Permissions p)
-
getDisabledSubsystems
public java.util.Set<java.lang.String> getDisabledSubsystems()
-
setDisabledSubsystems
public void setDisabledSubsystems(java.util.Set<java.lang.String> disabledSubsystems)
-
getServiceCleanups
public java.util.Set<RegisterServiceCleanupMessage> getServiceCleanups()
-
setServiceCleanups
public void setServiceCleanups(java.util.Set<RegisterServiceCleanupMessage> serviceCleanups)
-
getLockCandidates
public java.util.Set<ome.model.IObject> getLockCandidates()
-
setLockCandidates
public void setLockCandidates(java.util.Set<ome.model.IObject> lockCandidates)
-
getLogs
public java.util.List<ome.model.meta.EventLog> getLogs()
-
setLogs
public void setLogs(java.util.List<ome.model.meta.EventLog> logs)
-
getMemberOfGroupsList
public java.util.List<java.lang.Long> getMemberOfGroupsList()
- Specified by:
getMemberOfGroupsList
in interfaceome.system.EventContext
- Overrides:
getMemberOfGroupsList
in classome.system.SimpleEventContext
-
getLeaderOfGroupsList
public java.util.List<java.lang.Long> getLeaderOfGroupsList()
- Specified by:
getLeaderOfGroupsList
in interfaceome.system.EventContext
- Overrides:
getLeaderOfGroupsList
in classome.system.SimpleEventContext
-
setMemberOfGroups
public void setMemberOfGroups(java.util.List<java.lang.Long> groupIds)
-
setLeaderOfGroups
public void setLeaderOfGroups(java.util.List<java.lang.Long> groupIds)
-
getPermissionsForGroup
public ome.model.internal.Permissions getPermissionsForGroup(java.lang.Long group)
Never returnsPermissions.DUMMY
.- Parameters:
group
- a group ID, may benull
- Returns:
- the group's permissions, may be
null
-
setPermissionsForGroup
public ome.model.internal.Permissions setPermissionsForGroup(java.lang.Long group, ome.model.internal.Permissions perms)
Called duringBasicACLVoter.allowLoad(org.hibernate.Session, Class, ome.model.internal.Details, long)
to track groups that will need resolving later.- Parameters:
group
- a group ID, notnull
perms
- the group's permissions- Returns:
- the group's previous permissions, or
null
if none are noted
-
loadPermissions
public void loadPermissions(org.hibernate.Session session)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-