Migrate hibernate xml annotation to annotations

This commit is contained in:
Paulo Gustavo Veiga
2022-01-16 20:01:56 -08:00
parent 4668cba3bf
commit 7fc91abe59
105 changed files with 306 additions and 10790 deletions

View File

@@ -30,11 +30,13 @@ public class UpdateSecurityAdvise
extends BaseSecurityAdvice
implements MethodInterceptor {
@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
checkRole(methodInvocation);
return methodInvocation.proceed();
}
@Override
protected boolean isAllowed(@Nullable User user, @NotNull Mindmap map) {
boolean result;
if (map.getCreator() == null) {
@@ -46,6 +48,7 @@ public class UpdateSecurityAdvise
return result;
}
@Override
protected boolean isAllowed(@Nullable User user, int mapId) {
return getMindmapService().hasPermissions(user, mapId, CollaborationRole.EDITOR);
}

View File

@@ -30,15 +30,18 @@ public class ViewBaseSecurityAdvise
extends BaseSecurityAdvice
implements MethodInterceptor {
@Override
public Object invoke(@NotNull MethodInvocation methodInvocation) throws Throwable {
checkRole(methodInvocation);
return methodInvocation.proceed();
}
@Override
protected boolean isAllowed(@Nullable User user, Mindmap map) {
return getMindmapService().hasPermissions(user, map, CollaborationRole.VIEWER);
}
@Override
protected boolean isAllowed(@Nullable User user, int mapId) {
return getMindmapService().hasPermissions(user, mapId, CollaborationRole.VIEWER);
}