mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	Only ROOT/Domain admins and users belonging to the project can list project users
This commit is contained in:
		
							parent
							
								
									809ad8ce23
								
							
						
					
					
						commit
						5d47d024c1
					
				@ -635,8 +635,10 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
 | 
				
			|||||||
            throw new InvalidParameterValueException("Unable to find the project id=" + projectId);
 | 
					            throw new InvalidParameterValueException("Unable to find the project id=" + projectId);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        //verify permissions
 | 
					        //verify permissions - only accounts belonging to the project can list project's account
 | 
				
			||||||
        _accountMgr.checkAccess(caller, _domainDao.findById(project.getDomainId()));
 | 
					        if (!_accountMgr.isAdmin(caller.getType()) && _projectAccountDao.findByProjectIdAccountId(projectId, caller.getAccountId()) == null) {
 | 
				
			||||||
 | 
					            throw new PermissionDeniedException("Account " + caller + " is not authorized to list users of the project id=" + projectId);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        Filter searchFilter = new Filter(ProjectAccountVO.class, "id", false, startIndex, pageSizeVal);
 | 
					        Filter searchFilter = new Filter(ProjectAccountVO.class, "id", false, startIndex, pageSizeVal);
 | 
				
			||||||
        SearchBuilder<ProjectAccountVO> sb = _projectAccountDao.createSearchBuilder();
 | 
					        SearchBuilder<ProjectAccountVO> sb = _projectAccountDao.createSearchBuilder();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user