Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
// under the License.
package org.apache.cloudstack.api;

import com.cloud.user.Account;

import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.context.CallContext;

public abstract class BaseListDomainResourcesCmd extends BaseListCmd implements IBaseListDomainResourcesCmd {

Expand All @@ -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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be simplified to

Suggested change
return recursive == null ? true : recursive;
return recursive == null || recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more concise, less readable /m no me gusta

}
}
return recursive == null ? false : recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably be simplified to:

Suggested change
return recursive == null ? false : recursive;
return recursive != null && recursive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, that is not more expressive, i'd say.

}
Expand Down