public interface AccessControlService
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_DEFAULT_PASSWORD |
static String |
ADMIN_USERNAME |
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) |
Permissions |
getAssociationPermissions(long assocId) |
Collection<Association> |
getAssociationsByCreator(String username) |
Collection<Association> |
getAssociationsByOwner(String username) |
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(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 |
setWorkspaceOwner(Topic workspace,
String username)
Sets the owner of a workspace.
|
static final String ADMIN_USERNAME
static final String ADMIN_DEFAULT_PASSWORD
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 createUserAccount(Credentials cred)
Topic getPrivateWorkspace()
Note: a user can have more than one private workspace. The workspace returned by this method is the one that holds the user's password topic.
Topic getUsernameTopic(String username)
dm4.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)
dm4.accesscontrol.operation.write
.Permissions getAssociationPermissions(long assocId)
dm4.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)
Copyright © 2015. All Rights Reserved.