diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebUserContext.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebUserContext.java index 36b70e0b8a8..a9cab6694d4 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebUserContext.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebUserContext.java @@ -147,6 +147,7 @@ public synchronized void refreshSMSession() throws DBException { smCredentials.getSmSessionId(), smCredentials.getPermissions() ); + setUser(user == null ? null : new WebUser(securityController.getCurrentUser())); } /** diff --git a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java index 875de6b57db..5b36cf3b522 100644 --- a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java +++ b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java @@ -2213,11 +2213,7 @@ public void setObjectPermissions( @NotNull Set permissions, @NotNull String grantor ) throws DBException { - if (CommonUtils.isEmpty(objectIds)) { - subjectIds.forEach(id -> addSubjectPermissionsUpdateEvent(id, null)); - return; - } else if (CommonUtils.isEmpty(subjectIds)) { - addObjectPermissionsUpdateEvent(objectIds, objectType); + if (CommonUtils.isEmpty(objectIds) || CommonUtils.isEmpty(subjectIds)) { return; } Set filteredSubjects = getFilteredSubjects(subjectIds); @@ -2307,6 +2303,7 @@ public void deleteAllObjectPermissions(@NotNull String objectId, @NotNull SMObje } catch (SQLException e) { throw new DBCException("Error deleting object permissions", e); } + addObjectPermissionsUpdateEvent(Set.of(objectId), objectType); } @Override @@ -2321,6 +2318,7 @@ public void deleteAllSubjectObjectPermissions(@NotNull String subjectId, @NotNul } catch (SQLException e) { throw new DBCException("Error deleting subject permissions", e); } + addSubjectPermissionsUpdateEvent(subjectId, null); } @NotNull