Commit d231e908 authored by Malte Reißig's avatar Malte Reißig
Browse files

Fixes #24 (migrated to 5.2 API)

parent 7e4651d5
Pipeline #12833 passed with stages
in 7 minutes and 53 seconds
......@@ -643,20 +643,20 @@ public class SignupPlugin extends ThymeleafPlugin implements SignupPluginService
final Topic usernameTopic = acService._createUserAccount(creds);
final String eMailAddressValue = mailbox;
// 2) create and associate e-mail address topic in "Administration" Workspace
dmx.getPrivilegedAccess().runWithoutWorkspaceAssignment(new Callable<Topic>() {
dmx.getPrivilegedAccess().runInWorkspaceContext(-1, new Callable<Topic>() {
@Override
public Topic call() {
long adminWorkspaceId = dmx.getPrivilegedAccess().getAdminWorkspaceId();
long systemWorkspaceId = dmx.getPrivilegedAccess().getSystemWorkspaceId();
Topic eMailAddress = dmx.createTopic(mf.newTopicModel(MAILBOX_TYPE_URI,
new SimpleValue(eMailAddressValue)));
// 3) fire custom event ### this is useless since fired by "anonymous" (this request scope)
dmx.fireEvent(USER_ACCOUNT_CREATE_LISTENER, usernameTopic);
dmx.getPrivilegedAccess().assignToWorkspace(eMailAddress, adminWorkspaceId);
dmx.getPrivilegedAccess().assignToWorkspace(eMailAddress, systemWorkspaceId);
// 4) associate email address to "username" topic too
Assoc assoc = dmx.createAssoc(mf.newAssocModel(USER_MAILBOX_EDGE_TYPE,
mf.newTopicPlayerModel(eMailAddress.getId(), CHILD),
mf.newTopicPlayerModel(usernameTopic.getId(), PARENT)));
dmx.getPrivilegedAccess().assignToWorkspace(assoc, adminWorkspaceId);
dmx.getPrivilegedAccess().assignToWorkspace(assoc, systemWorkspaceId);
// 5) create membership to custom workspace topic
if (customWorkspaceAssignmentTopic != null) {
acService.createMembership(usernameTopic.getSimpleValue().toString(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment