Fix removal of maps shared in read-only.

This commit is contained in:
Paulo Gustavo Veiga 2022-10-05 20:27:41 -07:00
parent ad84282ef8
commit b97d5b1a00
4 changed files with 8 additions and 13 deletions

View File

@ -38,6 +38,7 @@ public class ViewBaseSecurityAdvise
@Override @Override
protected boolean isAllowed(@Nullable User user, Mindmap map) { protected boolean isAllowed(@Nullable User user, Mindmap map) {
System.out.println("VIEWWWWWWWWWWWWW");
return getMindmapService().hasPermissions(user, map, CollaborationRole.VIEWER); return getMindmapService().hasPermissions(user, map, CollaborationRole.VIEWER);
} }

View File

@ -68,6 +68,4 @@ public interface MindmapService {
LockManager getLockManager(); LockManager getLockManager();
boolean isAdmin(@Nullable User user); boolean isAdmin(@Nullable User user);
void purgeHistory(int mapId) throws IOException;
} }

View File

@ -91,11 +91,6 @@ public class MindmapServiceImpl
return user != null && user.getEmail() != null && user.getEmail().equals(adminUser); return user != null && user.getEmail() != null && user.getEmail().equals(adminUser);
} }
@Override
public void purgeHistory(int mapId) throws IOException {
mindmapManager.purgeHistory(mapId);
}
@Override @Override
public Mindmap getMindmapByTitle(String title, User user) { public Mindmap getMindmapByTitle(String title, User user) {
return mindmapManager.getMindmapByTitle(title, user); return mindmapManager.getMindmapByTitle(title, user);

View File

@ -14,6 +14,8 @@
<value>linkLabel</value> <value>linkLabel</value>
<value>find*</value> <value>find*</value>
<value>filter*</value> <value>filter*</value>
<!-- Remove can be performed in view only maps -->
<value>removeMindmap</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -26,19 +28,18 @@
<value>save*</value> <value>save*</value>
<value>update*</value> <value>update*</value>
<value>add*</value> <value>add*</value>
<value>remove*</value>
<value>purge*</value>
<value>revert*</value> <value>revert*</value>
<value>removeCollaboration</value>
</list> </list>
</property> </property>
</bean> </bean>
<bean id="updateSecurityAdvice" class="com.wisemapping.security.aop.UpdateSecurityAdvise">
<property name="mindmapService" ref="mindmapService"/>
</bean>
<bean id="viewSecurityAdvice" class="com.wisemapping.security.aop.ViewBaseSecurityAdvise"> <bean id="viewSecurityAdvice" class="com.wisemapping.security.aop.ViewBaseSecurityAdvise">
<property name="mindmapService" ref="mindmapService"/> <property name="mindmapService" ref="mindmapService"/>
</bean> </bean>
<bean id="updateSecurityAdvice" class="com.wisemapping.security.aop.UpdateSecurityAdvise">
<property name="mindmapService" ref="mindmapService"/>
</bean>
</beans> </beans>