Fix problem opening public maps.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-13 00:17:49 -03:00
parent 4c988d4ae2
commit a1199687d4
2 changed files with 15 additions and 4 deletions

View File

@ -20,6 +20,7 @@ package com.wisemapping.dao;
import com.wisemapping.model.*; import com.wisemapping.model.*;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
@ -37,6 +38,7 @@ public interface MindmapManager {
List<Mindmap> getAllMindmaps(); List<Mindmap> getAllMindmaps();
@Nullable
Mindmap getMindmapById(int mindmapId); Mindmap getMindmapById(int mindmapId);
Mindmap getMindmapByTitle(final String name, final User user); Mindmap getMindmapByTitle(final String name, final User user);

View File

@ -18,6 +18,7 @@
package com.wisemapping.view; package com.wisemapping.view;
import com.wisemapping.exceptions.AccessDeniedSecurityException;
import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.*; import com.wisemapping.model.*;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -126,14 +127,22 @@ public class MindMapBean {
} }
public String getProperties() throws WiseMappingException { public String getProperties() throws WiseMappingException {
String result; String result = null;
if (collaborator != null) { if (collaborator != null) {
try {
final CollaborationProperties properties = this.mindmap.findCollaborationProperties(collaborator); final CollaborationProperties properties = this.mindmap.findCollaborationProperties(collaborator);
result = properties.getMindmapProperties(); result = properties.getMindmapProperties();
} else { } catch (AccessDeniedSecurityException e) {
// Ignore exception. This is required for the admin could view maps ...
}
}
if (result == null) {
// It must be public view ... // It must be public view ...
result = CollaborationProperties.DEFAULT_JSON_PROPERTIES; result = CollaborationProperties.DEFAULT_JSON_PROPERTIES;
} }
return result; return result;
} }