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
protected boolean isAllowed(@Nullable User user, Mindmap map) {
System.out.println("VIEWWWWWWWWWWWWW");
return getMindmapService().hasPermissions(user, map, CollaborationRole.VIEWER);
}

View File

@ -68,6 +68,4 @@ public interface MindmapService {
LockManager getLockManager();
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);
}
@Override
public void purgeHistory(int mapId) throws IOException {
mindmapManager.purgeHistory(mapId);
}
@Override
public Mindmap getMindmapByTitle(String title, User user) {
return mindmapManager.getMindmapByTitle(title, user);

View File

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