You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/15 13:34:35 UTC
[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #6111: Set isrecursive to false when listall=true by default for users
Pearl1594 commented on a change in pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#discussion_r826978262
##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
@Override
public boolean isRecursive() {
if (listAll()) {
- return recursive == null ? true : recursive;
+ Account caller = CallContext.current().getCallingAccount();
+ if (caller.getType() != Account.Type.NORMAL) {
+ return recursive == null ? true : recursive;
Review comment:
Could be simplified to
```suggestion
return recursive == null || recursive;
```
##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
@Override
public boolean isRecursive() {
if (listAll()) {
- return recursive == null ? true : recursive;
+ Account caller = CallContext.current().getCallingAccount();
+ if (caller.getType() != Account.Type.NORMAL) {
+ return recursive == null ? true : recursive;
+ }
}
return recursive == null ? false : recursive;
Review comment:
Could probably be simplified to:
```suggestion
return recursive != null && recursive;
```
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org