public interface AccessControlService
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_INITIAL_PASSWORD |
static String |
ADMIN_USERNAME |
static String |
ADMINISTRATION_WORKSPACE_NAME |
static SharingMode |
ADMINISTRATION_WORKSPACE_SHARING_MODE |
static String |
ADMINISTRATION_WORKSPACE_URI |
static String |
DEFAULT_PRIVATE_WORKSPACE_NAME |
static String |
SYSTEM_WORKSPACE_NAME |
static SharingMode |
SYSTEM_WORKSPACE_SHARING_MODE |
static String |
SYSTEM_WORKSPACE_URI |
Modifier and Type | Method and Description |
---|---|
void |
createMembership(String username,
long workspaceId) |
Topic |
createUserAccount(Credentials cred) |
Topic |
createUsername(String username)
Creates a Username topic and a private workspace.
|
Permissions |
getAssociationPermissions(long assocId) |
Collection<Association> |
getAssociationsByCreator(String username) |
Collection<Association> |
getAssociationsByOwner(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.
|
Topic |
getPrivateWorkspace()
Returns the private workspace of the logged in user.
|
Permissions |
getTopicPermissions(long topicId) |
Collection<Topic> |
getTopicsByCreator(String username) |
Collection<Topic> |
getTopicsByOwner(String username) |
String |
getUsername()
Returns the username of the logged in user.
|
Topic |
getUsernameTopic()
Returns the "Username" topic of the logged in user.
|
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 weather 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(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 ADMINISTRATION_WORKSPACE_NAME
static final String ADMINISTRATION_WORKSPACE_URI
static final SharingMode ADMINISTRATION_WORKSPACE_SHARING_MODE
static final String SYSTEM_WORKSPACE_NAME
static final String SYSTEM_WORKSPACE_URI
static final 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.Topic getUsernameTopic()
dmx.accesscontrol.username
),
or null
if no user is logged in.Topic getPrivateWorkspace()
Note: a user can have more than one private workspace. This method returns only the first one.
RuntimeException
- if the logged in user has no private workspace.Topic createUserAccount(Credentials cred)
Topic createUsername(String username)
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(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.Permissions getTopicPermissions(long topicId)
dmx.accesscontrol.operation.write
.Permissions getAssociationPermissions(long assocId)
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<Topic> getTopicsByCreator(String username)
Collection<Topic> getTopicsByOwner(String username)
Collection<Association> getAssociationsByCreator(String username)
Collection<Association> getAssociationsByOwner(String username)
void registerAuthorizationMethod(String name, AuthorizationMethod am)
void unregisterAuthorizationMethod(String name)
Set<String> getAuthorizationMethods()
Copyright © 2018. All Rights Reserved.