}
public WebWorkspace createWorkspace(String workspaceName) throws CoreException {
// see org.eclipse.orion.server.servlets.WorkspaceServlet.doCreateWorkspace()
WebWorkspace workspace = webuser.createWorkspace(workspaceName);
URI loc = URI.create(Activator.LOCATION_WORKSPACE_SERVLET);
JSONObject result = WorkspaceResourceHandler.toJSON(workspace, loc, loc);
String resultLocation = result.optString(ProtocolConstants.KEY_LOCATION);
// add user rights for the workspace
AuthorizationService.addUserRight(this.getUserID(), URI.create(resultLocation).getPath());
AuthorizationService.addUserRight(this.getUserID(), URI.create(resultLocation).getPath() + "/*"); //$NON-NLS-1$
// add user rights for file servlet location
String filePath = Activator.LOCATION_FILE_SERVLET + '/' + workspace.getId();
AuthorizationService.addUserRight(this.getUserID(), filePath);
AuthorizationService.addUserRight(this.getUserID(), filePath + "/*"); //$NON-NLS-1$
return workspace;
}