Skip to content

Commit

Permalink
CB-3945 subject object event fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yagudin10 committed Sep 20, 2023
1 parent 18b8f6d commit 1f76bef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public synchronized void refreshSMSession() throws DBException {
smCredentials.getSmSessionId(),
smCredentials.getPermissions()
);
setUser(user == null ? null : new WebUser(securityController.getCurrentUser()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2213,11 +2213,7 @@ public void setObjectPermissions(
@NotNull Set<String> 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<String> filteredSubjects = getFilteredSubjects(subjectIds);
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1f76bef

Please sign in to comment.