Package systems.dmx.accesscontrol
Interface AccessControlService
- 
- All Known Implementing Classes:
- AccessControlPlugin
 
 public interface AccessControlService
- 
- 
Field SummaryFields Modifier and Type Field Description static StringADMIN_INITIAL_PASSWORDstatic StringADMIN_USERNAMEstatic StringADMIN_WORKSPACE_NAMEstatic SharingModeADMIN_WORKSPACE_SHARING_MODEstatic StringADMIN_WORKSPACE_URIstatic StringDEFAULT_PRIVATE_WORKSPACE_NAMEstatic StringSYSTEM_WORKSPACE_NAMEstatic SharingModeSYSTEM_WORKSPACE_SHARING_MODEstatic StringSYSTEM_WORKSPACE_URI
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Topic_createUserAccount(Credentials cred)Deprecated.List<RelatedTopic>bulkUpdateMemberships(long workspaceId, IdList addUserIds, IdList removeUserIds)List<RelatedTopic>bulkUpdateMemberships(String username, IdList addWorkspaceIds, IdList removeWorkspaceIds)voidcheckAdmin()Checks if the current user is a DMX admin and throws AccessControlException if not.voidcreateMembership(String username, long workspaceId)Makes the given user a member of the given workspace.TopiccreateUserAccount(Credentials cred)Deprecated.TopiccreateUsername(String username)Deprecated.voidenrichWithOwnerInfo(Topic workspace)Retrieves the OWNER and stores it in the given topic's model (under synthetic child type URIdmx.accesscontrol.owner).voidenrichWithUserInfo(DMXObject object)Retrieves the CREATOR/MODIFIER usernames and stores them in the given object's model (under synthetic child type URIsdmx.accesscontrol.creatoranddmx.accesscontrol.modifier).longgetAdminWorkspaceId()Collection<Assoc>getAssocsByCreator(String username)Set<String>getAuthorizationMethods()Returns the names of all authorization methods, as registered byregisterAuthorizationMethod(java.lang.String, systems.dmx.accesscontrol.AuthorizationMethod).StringgetCreator(long objectId)Returns the creator of a topic or an association.AssocgetMembership(String username, long workspaceId)List<RelatedTopic>getMemberships(long workspaceId)Returns the members of the given workspace.List<RelatedTopic>getMemberships(String username)Returns the workspaces of the given user.StringgetModifier(long objectId)Returns the modifier of a topic or an association.PermissionsgetPermissions(long objectId)TopicgetPrivateWorkspace()Returns the private workspace of the logged in user.Collection<Topic>getTopicsByCreator(String username)StringgetUsername()Returns the username of the logged in user.TopicgetUsernameTopic()Returns the "Username" topic of the logged in user.TopicgetUsernameTopic(String username)Returns the "Username" topic for the specified username (case-insensitive).StringgetWorkspaceOwner(long workspaceId)Returns the owner of a workspace.Collection<Topic>getWorkspacesByOwner(String username)booleanisMember(String username, long workspaceId)Checks if a user is a member of the given workspace.voidlogin()Checks whether the credentials in the authorization string match an existing User Account, and if so, creates an HTTP session.voidlogout()Logs the user out.voidregisterAuthorizationMethod(String name, AuthorizationMethod am)Registers an authorization method under the given name, e.g.voidsetWorkspaceOwner(Topic workspace, String username)Sets the owner of a workspace.voidunregisterAuthorizationMethod(String name)Unregisters the authorization method that has been registered under the given name.
 
- 
- 
- 
Field Detail- 
ADMIN_USERNAMEstatic final String ADMIN_USERNAME - See Also:
- Constant Field Values
 
 - 
ADMIN_INITIAL_PASSWORDstatic final String ADMIN_INITIAL_PASSWORD 
 - 
ADMIN_WORKSPACE_NAMEstatic final String ADMIN_WORKSPACE_NAME - See Also:
- Constant Field Values
 
 - 
ADMIN_WORKSPACE_URIstatic final String ADMIN_WORKSPACE_URI - See Also:
- Constant Field Values
 
 - 
ADMIN_WORKSPACE_SHARING_MODEstatic final SharingMode ADMIN_WORKSPACE_SHARING_MODE 
 - 
SYSTEM_WORKSPACE_NAMEstatic final String SYSTEM_WORKSPACE_NAME - See Also:
- Constant Field Values
 
 - 
SYSTEM_WORKSPACE_URIstatic final String SYSTEM_WORKSPACE_URI - See Also:
- Constant Field Values
 
 - 
SYSTEM_WORKSPACE_SHARING_MODEstatic final SharingMode SYSTEM_WORKSPACE_SHARING_MODE 
 - 
DEFAULT_PRIVATE_WORKSPACE_NAMEstatic final String DEFAULT_PRIVATE_WORKSPACE_NAME - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createUserAccount@Deprecated Topic createUserAccount(Credentials cred) Deprecated.
 - 
_createUserAccount@Deprecated Topic _createUserAccount(Credentials cred) throws Exception Deprecated.- Throws:
- Exception
 
 - 
createUsername@Deprecated Topic createUsername(String username) Deprecated.
 - 
loginvoid login() Checks whether 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}".
 
 - 
logoutvoid 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.
 - 
getUsernameString getUsername() Returns the username of the logged in user.- Returns:
- The username, or nullif no user is logged in.
 
 - 
getUsernameTopicTopic getUsernameTopic() Returns the "Username" topic of the logged in user.- Returns:
- The "Username" topic (type dmx.accesscontrol.username), ornullif no user is logged in.
 
 - 
getPrivateWorkspaceTopic getPrivateWorkspace() Returns the private workspace of the logged in user.Note: a user can have more than one private workspace. This method returns only the first one. - Returns:
- The logged in user's private workspace (a topic of type "Workspace").
- Throws:
- IllegalStateException- if no user is logged in.
- RuntimeException- if the logged in user has no private workspace.
 
 - 
checkAdminvoid checkAdmin() Checks if the current user is a DMX admin and throws AccessControlException if not. Note: if invoked as "System" no AccessControlException is thrown.- Throws:
- AccessControlException- if the current user is not a DMX admin.
 
 - 
getUsernameTopicTopic getUsernameTopic(String username) Returns the "Username" topic for the specified username (case-insensitive).- Parameters:
- username- a username. Must not be null.
- Returns:
- The "Username" topic (type dmx.accesscontrol.username), ornullif no such username exists.
 
 - 
getWorkspaceOwnerString getWorkspaceOwner(long workspaceId) Returns the owner of a workspace.- Returns:
- The username of the owner, or nullif no owner is set.
 
 - 
setWorkspaceOwnervoid 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.
 - 
enrichWithOwnerInfovoid enrichWithOwnerInfo(Topic workspace) Retrieves the OWNER and stores it in the given topic's model (under synthetic child type URIdmx.accesscontrol.owner).
 - 
getMembershipsList<RelatedTopic> getMemberships(String username) Returns the workspaces of the given user.- Returns:
- a list of Workspace topics. The "relating" part is the Membership association.
 
 - 
getMembershipsList<RelatedTopic> getMemberships(long workspaceId) Returns the members of the given workspace.- Returns:
- a list of Username topics. The "relating" part is the Membership association.
 
 - 
isMemberboolean isMember(String username, long workspaceId) Checks if a user is a member of the given workspace.- Parameters:
- username- the user. If- nullis passed,- falseis returned. If an unknown username is passed an exception is thrown.
- workspaceId- the workspace.
- Returns:
- trueif the user is a member,- falseotherwise.
 
 - 
getMembershipAssoc getMembership(String username, long workspaceId) - Returns:
- the Membership assoc between the given username and workspace, or nullif the user is not a member.
 
 - 
createMembershipvoid createMembership(String username, long workspaceId) Makes the given user a member of the given workspace.
 - 
bulkUpdateMembershipsList<RelatedTopic> bulkUpdateMemberships(String username, IdList addWorkspaceIds, IdList removeWorkspaceIds) - Returns:
- a list of Workspace topics. The "relating" part is the Membership association.
 
 - 
bulkUpdateMembershipsList<RelatedTopic> bulkUpdateMemberships(long workspaceId, IdList addUserIds, IdList removeUserIds) - Returns:
- a list of Username topics. The "relating" part is the Membership association.
 
 - 
getAdminWorkspaceIdlong getAdminWorkspaceId() 
 - 
getPermissionsPermissions getPermissions(long objectId) - Parameters:
- objectId- a topic ID, or an association ID.
- Returns:
- A Permissions object with one entry: dmx.accesscontrol.operation.write.
 
 - 
getCreatorString getCreator(long objectId) Returns the creator of a topic or an association.- Returns:
- The username of the creator, or nullif no creator is set.
 
 - 
getModifierString getModifier(long objectId) Returns the modifier of a topic or an association.- Returns:
- The username of the modifier, or nullif no modifier is set.
 
 - 
enrichWithUserInfovoid enrichWithUserInfo(DMXObject object) Retrieves the CREATOR/MODIFIER usernames and stores them in the given object's model (under synthetic child type URIsdmx.accesscontrol.creatoranddmx.accesscontrol.modifier).
 - 
getWorkspacesByOwnerCollection<Topic> getWorkspacesByOwner(String username) 
 - 
getTopicsByCreatorCollection<Topic> getTopicsByCreator(String username) 
 - 
getAssocsByCreatorCollection<Assoc> getAssocsByCreator(String username) 
 - 
getAuthorizationMethodsSet<String> getAuthorizationMethods() Returns the names of all authorization methods, as registered byregisterAuthorizationMethod(java.lang.String, systems.dmx.accesscontrol.AuthorizationMethod).- Returns:
- the names of all registered authorization methods. Might be empty.
          Note: authorization method "BASIC" is not included. This one is not registered by
          registerAuthorizationMethod(java.lang.String, systems.dmx.accesscontrol.AuthorizationMethod), but is an integral part of the DMX platform.
 
 - 
registerAuthorizationMethodvoid registerAuthorizationMethod(String name, AuthorizationMethod am) Registers an authorization method under the given name, e.g. "LDAP".- Throws:
- RuntimeException- if an authorization method is already registered under the given name.
 
 - 
unregisterAuthorizationMethodvoid unregisterAuthorizationMethod(String name) Unregisters the authorization method that has been registered under the given name. If no authorization method is registered under that name, nothing happens.
 
- 
 
-