|
3.0.4: 2012-03-05 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.core.SessionControl
net.sf.basedb.core.PluginSessionControl
class PluginSessionControl
This is a special session control implementation that is used for executing plugins that prevents them from logging in or out. If the plugin has enabled permissions those permissions are also loaded and taken into account when checking access to items.
Field Summary | |
---|---|
private SessionControl |
parent
|
Constructor Summary | |
---|---|
PluginSessionControl(String id,
SessionControl parent,
PluginDefinition plugin,
Job job)
Create a new plugin session control |
Method Summary | |
---|---|
PluginSessionControl |
getPluginSessionControl(PluginDefinition plugin,
Job job)
Create a new session control for executing a plugin using the same parent as this session control has. |
SessionControl |
impersonateLogin(int userId,
String comment)
Log in as another user or create a clone of the currently logged in user's session. |
SessionControl |
impersonateLogin(Ownable item,
String comment)
Log in as the owner of the specified item. |
(package private) void |
login(Keyring keyring)
|
void |
login(String login,
String password,
String comment)
Log in to BASE. |
void |
logout()
Do nothing, a plugin is not allowed to log out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final SessionControl parent
Constructor Detail |
---|
PluginSessionControl(String id, SessionControl parent, PluginDefinition plugin, Job job)
id
- The ID of the session controlparent
- The parent session control which settings and permissions
should be copied fromplugin
- The plugin that is executingMethod Detail |
---|
void login(Keyring keyring)
login
in class SessionControl
PermissionDeniedException
- Alwayspublic void login(String login, String password, String comment) throws ItemNotFoundException, PermissionDeniedException, InvalidPasswordException, BaseException
SessionControl
login
in class SessionControl
login
- The login of the userpassword
- The UTF-8 encoded plain-text password for the usercomment
- A comment for the login, which will show in the Session
PermissionDeniedException
- Always
ItemNotFoundException
- If a user with the specified username is not found
InvalidPasswordException
- If the specified password is incorrect
BaseException
- If there is any other errorSessionControl.logout()
,
SessionControl.isLoggedIn()
,
SessionControl.getLoggedInUserId()
public void logout() throws BaseException
logout
in class SessionControl
BaseException
- If there is an errorSessionControl.login(String, String, String)
,
SessionControl.isLoggedIn()
,
SessionControl.impersonateLogin(int, String)
,
SessionControl.isImpersonated()
public SessionControl impersonateLogin(int userId, String comment) throws ItemNotFoundException, PermissionDeniedException, BaseException
SessionControl
SessionControl
object which
is equivalent to a SessionControl
where that user logged in by normal means.
This method requires that the logged in user has Permission.ACT_AS_ANOTHER_USER
permission or that the userId is the same as the currently logged in user.
impersonateLogin
in class SessionControl
userId
- The id of the user to login ascomment
- A comment that will be placed in the Session
information
SessionControl
object
PermissionDeniedException
- Always
ItemNotFoundException
- If no user with the specified id exists
BaseException
- If there is another errorpublic SessionControl impersonateLogin(Ownable item, String comment)
SessionControl
impersonateLogin
in class SessionControl
item
- Login as the owner of this Item. Null is not allowedcomment
- A comment that will be placed in the Session
information
SessionControl
for the created session.
PermissionDeniedException
- AlwaysSessionControl.impersonateLogin(int, String)
public PluginSessionControl getPluginSessionControl(PluginDefinition plugin, Job job)
getPluginSessionControl
in class SessionControl
plugin
- The plugin to executejob
- The job that executes the plug-in, or null
|
3.0.4: 2012-03-05 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |