public class CurrentDetails extends Object implements PrincipalHolder
Constructor and Description |
---|
CurrentDetails()
Default constructor.
|
CurrentDetails(SessionCache cache) |
CurrentDetails(SessionCache cache,
Roles roles) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAllDisabled(String... ids) |
void |
addCleanup(RegisterServiceCleanupMessage cleanup)
Add a
RegisterServiceCleanupMessage to the current thread for
cleanup by the ServiceHandler on exit. |
boolean |
addDisabled(String id) |
void |
addLog(String action,
Class klass,
Long id) |
void |
applyContext(Details details,
boolean changePerms) |
protected void |
checkDelayedCallContext(BasicEventContext bec) |
void |
clearDisabled() |
void |
clearLogs() |
Details |
createDetails()
Creates a
Details object for the current security context. |
Set<RegisterServiceCleanupMessage> |
emptyCleanups()
Returns the current cleanups and resets the
Set . |
Map<String,String> |
getContext() |
EventContext |
getCurrentEventContext()
Public view on the data contained here.
|
Event |
getEvent() |
ExperimenterGroup |
getGroup() |
Principal |
getLast()
Get the last, i.e. currently active, principal.
|
List<EventLog> |
getLogs() |
Experimenter |
getOwner() |
SessionStats |
getStats() |
void |
invalidateCurrentEventContext()
It suffices to set the
Details to a new instance to make this
context unusable. |
boolean |
isDisabled(String id) |
boolean |
isGraphCritical(Details details) |
boolean |
isOwnerOrSupervisor(IObject object) |
boolean |
isReady()
Checks if the current
Thread has non-null Experimenter ,
Event , and ExperimenterGroup , required for proper
functioning of the security system. |
void |
loadPermissions(org.hibernate.Session session)
Checks the "groupPermissions" map in
BasicEventContext which has
been filled up by calls to BasicEventContext.setPermissionsForGroup(Long, Permissions)
during BasicACLVoter.allowLoad(org.hibernate.Session, Class, Details, long) . |
void |
login(BasicEventContext bec)
Login method which can be used by the security system to replace the
existing
BasicEventContext . |
void |
login(Principal principal)
Add a new principal context to the stack.
|
int |
logout()
Pop the last created principal context and return the number of active
contexts remaining.
|
Event |
newEvent(Session session,
EventType type,
TokenHolder tokenHolder) |
boolean |
removeAllDisabled(String... ids) |
boolean |
removeDisabled(String id) |
Map<String,String> |
setContext(Map<String,String> ctx) |
int |
size()
Get the number of active principal contexts.
|
public CurrentDetails()
public CurrentDetails(SessionCache cache)
public CurrentDetails(SessionCache cache, Roles roles)
protected void checkDelayedCallContext(BasicEventContext bec)
public int size()
PrincipalHolder
size
in interface PrincipalHolder
public Principal getLast()
PrincipalHolder
getLast
in interface PrincipalHolder
public void login(Principal principal)
PrincipalHolder
login
in interface PrincipalHolder
public void login(BasicEventContext bec)
BasicEventContext
.login
in interface PrincipalHolder
public int logout()
PrincipalHolder
logout
in interface PrincipalHolder
public boolean isReady()
Thread
has non-null Experimenter
,
Event
, and ExperimenterGroup
, required for proper
functioning of the security system.public boolean isGraphCritical(Details details)
public boolean isOwnerOrSupervisor(IObject object)
public EventContext getCurrentEventContext()
public void invalidateCurrentEventContext()
public Event newEvent(Session session, EventType type, TokenHolder tokenHolder)
public SessionStats getStats()
public void clearLogs()
public Details createDetails()
Details
object for the current security context.
The Permissions
on the instance are calculated from the current
group as well as the user's umask.public void applyContext(Details details, boolean changePerms)
public void loadPermissions(org.hibernate.Session session)
BasicEventContext
which has
been filled up by calls to BasicEventContext.setPermissionsForGroup(Long, Permissions)
during BasicACLVoter.allowLoad(org.hibernate.Session, Class, Details, long)
.public Experimenter getOwner()
public ExperimenterGroup getGroup()
public Event getEvent()
public void addCleanup(RegisterServiceCleanupMessage cleanup)
RegisterServiceCleanupMessage
to the current thread for
cleanup by the ServiceHandler
on exit.public Set<RegisterServiceCleanupMessage> emptyCleanups()
Set
. Instances can
most likely only be closed once, so it doesn't make sense to keep them
around. The first caller of this method is responsible for closing all of
them.public boolean addDisabled(String id)
public boolean addAllDisabled(String... ids)
public boolean removeDisabled(String id)
public boolean removeAllDisabled(String... ids)
public void clearDisabled()
public boolean isDisabled(String id)
Version: 5.1.4-ice35-b55
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.