mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +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);
|
||||
}
|
||||
|
||||
//verify permissions
|
||||
_accountMgr.checkAccess(caller, _domainDao.findById(project.getDomainId()));
|
||||
//verify permissions - only accounts belonging to the project can list project's account
|
||||
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);
|
||||
SearchBuilder<ProjectAccountVO> sb = _projectAccountDao.createSearchBuilder();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user