public interface AccessControlService
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN_INITIAL_PASSWORD |
static String |
ADMIN_USERNAME |
static String |
ADMIN_WORKSPACE_NAME |
static systems.dmx.core.service.accesscontrol.SharingMode |
ADMIN_WORKSPACE_SHARING_MODE |
static String |
ADMIN_WORKSPACE_URI |
static String |
DEFAULT_PRIVATE_WORKSPACE_NAME |
static String |
SYSTEM_WORKSPACE_NAME |
static systems.dmx.core.service.accesscontrol.SharingMode |
SYSTEM_WORKSPACE_SHARING_MODE |
static String |
SYSTEM_WORKSPACE_URI |
| Modifier and Type | Method and Description |
|---|---|
systems.dmx.core.Topic |
_createUserAccount(systems.dmx.core.service.accesscontrol.Credentials cred)
Creates an user account.
|
void |
checkAdmin()
Checks if the current user is a DMX admin and throws AccessControlException if not.
|
void |
createMembership(String username,
long workspaceId) |
systems.dmx.core.Topic |
createUserAccount(systems.dmx.core.service.accesscontrol.Credentials cred)
Creates an user account.
|
systems.dmx.core.Topic |
createUsername(String username)
Creates a Username topic and a private workspace.
|
long |
getAdminWorkspaceId() |
Collection<systems.dmx.core.Assoc> |
getAssocsByCreator(String username) |
Collection<systems.dmx.core.Assoc> |
getAssocsByOwner(String username) |
Set<String> |
getAuthorizationMethods() |
String |
getCreator(long objectId)
Returns the creator of a topic or an association.
|
String |
getModifier(long objectId)
Returns the modifier of a topic or an association.
|
systems.dmx.core.service.accesscontrol.Permissions |
getPermissions(long objectId) |
systems.dmx.core.Topic |
getPrivateWorkspace()
Returns the private workspace of the logged in user.
|
Collection<systems.dmx.core.Topic> |
getTopicsByCreator(String username) |
Collection<systems.dmx.core.Topic> |
getTopicsByOwner(String username) |
String |
getUsername()
Returns the username of the logged in user.
|
systems.dmx.core.Topic |
getUsernameTopic()
Returns the "Username" topic of the logged in user.
|
systems.dmx.core.Topic |
getUsernameTopic(String username)
Returns the "Username" topic for the specified username.
|
String |
getWorkspaceOwner(long workspaceId)
Returns the owner of a workspace.
|
boolean |
isMember(String username,
long workspaceId)
Checks if a user is a member of the given workspace.
|
void |
login()
Checks whether the credentials in the authorization string match an existing User Account,
and if so, creates an HTTP session.
|
void |
logout()
Logs the user out.
|
void |
registerAuthorizationMethod(String name,
AuthorizationMethod am) |
void |
setWorkspaceOwner(systems.dmx.core.Topic workspace,
String username)
Sets the owner of a workspace.
|
void |
unregisterAuthorizationMethod(String name) |
static final String ADMIN_USERNAME
static final String ADMIN_INITIAL_PASSWORD
static final String ADMIN_WORKSPACE_NAME
static final String ADMIN_WORKSPACE_URI
static final systems.dmx.core.service.accesscontrol.SharingMode ADMIN_WORKSPACE_SHARING_MODE
static final String SYSTEM_WORKSPACE_NAME
static final String SYSTEM_WORKSPACE_URI
static final systems.dmx.core.service.accesscontrol.SharingMode SYSTEM_WORKSPACE_SHARING_MODE
static final String DEFAULT_PRIVATE_WORKSPACE_NAME
void login()
authHeader - the authorization string containing the credentials. ### FIXDOC
Formatted like a "Authorization" HTTP header value. That is, "Basic " appended by the
Base64 encoded form of "{username}:{password}".void logout()
String getUsername()
null if no user is logged in.systems.dmx.core.Topic getUsernameTopic()
dmx.accesscontrol.username),
or null if no user is logged in.systems.dmx.core.Topic getPrivateWorkspace()
Note: a user can have more than one private workspace. This method returns only the first one.
IllegalStateException - if no user is logged in.RuntimeException - if the logged in user has no private workspace.void checkAdmin()
AccessControlException - if the current user is not a DMX admin.systems.dmx.core.Topic createUserAccount(systems.dmx.core.service.accesscontrol.Credentials cred)
RuntimeException - if the requesting user is not a DMX admin.systems.dmx.core.Topic _createUserAccount(systems.dmx.core.service.accesscontrol.Credentials cred)
throws Exception
Security: this method is not callable from outside as it has no REST interface. So the DMX platform is still secure. On the other hand, a 3rd-party plugin which provides a RESTful interface to this method is required to apply an additional authorization measure, e.g. a short-living access token sent via email.
Exceptionsystems.dmx.core.Topic createUsername(String username)
systems.dmx.core.Topic getUsernameTopic(String username)
username - a username. Must not be null.dmx.accesscontrol.username),
or null if no such username exists.String getWorkspaceOwner(long workspaceId)
null if no owner is set.
### TODO: should throw an exception instead of returning nullvoid setWorkspaceOwner(systems.dmx.core.Topic workspace,
String username)
void createMembership(String username, long workspaceId)
boolean isMember(String username, long workspaceId)
username - the user.
If null is passed, false is returned.
If an unknown username is passed an exception is thrown.workspaceId - the workspace.true if the user is a member, false otherwise.long getAdminWorkspaceId()
systems.dmx.core.service.accesscontrol.Permissions getPermissions(long objectId)
objectId - a topic ID, or an association ID.dmx.accesscontrol.operation.write.String getCreator(long objectId)
null if no creator is set.String getModifier(long objectId)
null if no modifier is set.Collection<systems.dmx.core.Topic> getTopicsByCreator(String username)
Collection<systems.dmx.core.Topic> getTopicsByOwner(String username)
Collection<systems.dmx.core.Assoc> getAssocsByCreator(String username)
Collection<systems.dmx.core.Assoc> getAssocsByOwner(String username)
void registerAuthorizationMethod(String name, AuthorizationMethod am)
void unregisterAuthorizationMethod(String name)
Copyright © 2021. All rights reserved.