sureshanaparti commented on code in PR #10008:
URL: https://github.com/apache/cloudstack/pull/10008#discussion_r1863523592
##########
engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java:
##########
@@ -194,6 +194,15 @@ public void removeAccountFromProjects(long accountId) {
}
}
+ @Override
+ public void removeUserFromProjects(long userId) {
+ SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
+ sc.setParameters("userId", userId);
+
+ int count = remove(sc);
+ s_logger.debug(String.format("Removed user [%s] from %s project(s).",
userId, count));
Review Comment:
```suggestion
if (removedCount > 0) {
s_logger.debug(String.format("Removed user [%s] from %s
project(s).", userId, count));
}
```
##########
engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java:
##########
@@ -194,6 +194,15 @@ public void removeAccountFromProjects(long accountId) {
}
}
+ @Override
+ public void removeUserFromProjects(long userId) {
+ SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
+ sc.setParameters("userId", userId);
+
+ int count = remove(sc);
+ s_logger.debug(String.format("Removed user [%s] from %s project(s).",
userId, count));
Review Comment:
```suggestion
if (removedCount > 0) {
s_logger.debug(String.format("Removed user [%s] from %s
project(s).", userId, removedCount));
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]