Skip to content

Commit 27e8836

Browse files
committed
revert change from other PR
1 parent aed3c42 commit 27e8836

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,17 +2955,18 @@ public void buildACLSearchParameters(Account caller, Long id, String accountName
29552955
if (projectId != null) {
29562956
if (!forProjectInvitation) {
29572957
if (projectId == -1L) {
2958-
domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly);
2959-
if (caller.getType() != Account.Type.ADMIN) {
2958+
if (caller.getType() == Account.Type.ADMIN) {
2959+
domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly);
2960+
if (listAll) {
2961+
domainIdRecursiveListProject.third(ListProjectResourcesCriteria.ListAllIncludingProjectResources);
2962+
}
2963+
} else {
29602964
permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId()));
29612965
// permittedAccounts can be empty when the caller is not a part of any project (a domain account)
29622966
if (permittedAccounts.isEmpty()) {
29632967
permittedAccounts.add(caller.getId());
29642968
}
29652969
}
2966-
if (listAll) {
2967-
domainIdRecursiveListProject.third(ListProjectResourcesCriteria.ListAllIncludingProjectResources);
2968-
}
29692970
} else {
29702971
Project project = _projectMgr.getProject(projectId);
29712972
if (project == null) {

0 commit comments

Comments
 (0)