de.deepamehta.plugins.accesscontrol.service
Interface AccessControlService

Show UML class diagram
All Superinterfaces:
PluginService
All Known Implementing Classes:
AccessControlPlugin

public interface AccessControlService
extends PluginService


Field Summary
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
           
 
Method Summary
 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.
 

Field Detail

ADMIN_USERNAME

static final String ADMIN_USERNAME
See Also:
Constant Field Values

ADMIN_DEFAULT_PASSWORD

static final String ADMIN_DEFAULT_PASSWORD
See Also:
Constant Field Values

SYSTEM_WORKSPACE_NAME

static final String SYSTEM_WORKSPACE_NAME
See Also:
Constant Field Values

SYSTEM_WORKSPACE_URI

static final String SYSTEM_WORKSPACE_URI
See Also:
Constant Field Values

SYSTEM_WORKSPACE_SHARING_MODE

static final SharingMode SYSTEM_WORKSPACE_SHARING_MODE

DEFAULT_PRIVATE_WORKSPACE_NAME

static final String DEFAULT_PRIVATE_WORKSPACE_NAME
See Also:
Constant Field Values
Method Detail

login

void login()
Checks weather the credentials in the authorization string match an existing User Account, and if so, creates an HTTP session. ### FIXDOC

Parameters:
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}".

logout

void logout()
Logs the user out. That is invalidating the session associated with the JSESSION ID cookie. For a "non-private" DM installation the response is 204 No Content. For a "private" DM installation the response is 401 Authorization Required. In this case the webclient is supposed to shutdown the DM GUI then. The webclient of a "private" DM installation must only be visible/usable when logged in.


getUsername

String getUsername()
Returns the username of the logged in user.

Returns:
The username, or null if no user is logged in.

createUserAccount

Topic createUserAccount(Credentials cred)
Returns:
The "Username" topic of the created user account.

getPrivateWorkspace

Topic getPrivateWorkspace()
Returns the private workspace of the logged in user. If no user is logged in an exception is thrown.

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.


getUsernameTopic

Topic getUsernameTopic(String username)
Returns the "Username" topic for the specified username.

Returns:
The "Username" topic (type dm4.accesscontrol.username), or null if no such username exists.

getWorkspaceOwner

String getWorkspaceOwner(long workspaceId)
Returns the owner of a workspace.

Returns:
The username of the owner, or null if no owner is set. ### TODO: should throw an exception instead of returning null

setWorkspaceOwner

void setWorkspaceOwner(Topic workspace,
                       String username)
Sets the owner of a workspace. ### TODO: should take an ID instead a topic. ### Core service must be extended with a property setter.


createMembership

void createMembership(String username,
                      long workspaceId)

isMember

boolean isMember(String username,
                 long workspaceId)
Checks if a user is a member of the given workspace.

Parameters:
username - the user. If null is passed, false is returned. If an unknown username is passed an exception is thrown.
workspaceId - the workspace.
Returns:
true if the user is a member, false otherwise.

getTopicPermissions

Permissions getTopicPermissions(long topicId)
Returns:
A Permissions object with one entry: dm4.accesscontrol.operation.write.

getAssociationPermissions

Permissions getAssociationPermissions(long assocId)
Returns:
A Permissions object with one entry: dm4.accesscontrol.operation.write.

getCreator

String getCreator(long objectId)
Returns the creator of a topic or an association.

Returns:
The username of the creator, or null if no creator is set.

getModifier

String getModifier(long objectId)
Returns the modifier of a topic or an association.

Returns:
The username of the modifier, or null if no modifier is set.

getTopicsByCreator

Collection<Topic> getTopicsByCreator(String username)

getTopicsByOwner

Collection<Topic> getTopicsByOwner(String username)

getAssociationsByCreator

Collection<Association> getAssociationsByCreator(String username)

getAssociationsByOwner

Collection<Association> getAssociationsByOwner(String username)


Copyright © 2015. All Rights Reserved.