capabilities.put("cloudStackVersion", getVersion()); capabilities.put("supportELB", supportELB); capabilities.put("projectInviteRequired", _projectMgr.projectInviteRequired()); capabilities.put("allowusercreateprojects", _projectMgr.allowUserToCreateProject()); capabilities.put("customDiskOffMinSize", diskOffMinSize); capabilities.put("customDiskOffMaxSize", diskOffMaxSize);
if (projectId.longValue() == -1) { if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId); if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { throw new PermissionDeniedException("Account " + caller + " can't access project id=" + projectId);
if (owner.getType() == Account.ACCOUNT_TYPE_PROJECT && _projectMgr.canAccessProjectAccount(caller, owner.getId())) { return true; if (!_accountService.isRootAdmin(caller.getId()) && owner.getId() != caller.getId()) { if (owner.getType() != Account.ACCOUNT_TYPE_PROJECT || !(_projectMgr.canAccessProjectAccount(caller, owner.getId()))) { throw new PermissionDeniedException("Domain Admin and regular users can modify only their own Public templates"); if (!_projectMgr.canModifyProjectAccount(caller, account.getId())) { throw new PermissionDeniedException(caller + " does not have permission to operate with resource " + entity); } else if (!_projectMgr.canAccessProjectAccount(caller, account.getId())) { throw new PermissionDeniedException(caller + " does not have permission to operate with resource " + entity);
Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId); if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { throw new InvalidParameterValueException("Account " + caller + " can't access project id=" + projectId);
throw new InvalidParameterValueException("accountName and projectId are mutually exclusive"); Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId);
if (projectAccount == null) { s_logger.debug("Removing inactive project id=" + project.getId()); _projectMgr.deleteProject(CallContext.current().getCallingAccount(), CallContext.current().getCallingUserId(), project); } else { s_logger.debug("Can't remove disabled project " + project + " as it has non removed account id=" + project.getId());
sc.setParameters("created", new Date((DateUtil.currentGMTTime().getTime()) - _projectMgr.getInvitationTimeout()));
if (!_projectMgr.canAccessProjectAccount(account, owner.getId())) { throw new PermissionDeniedException(msg + ". Permission denied. The caller can't access project's template");
Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id=" + projectId); if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { throw new PermissionDeniedException("Account " + caller + " is unauthorised to use project id=" + projectId);
throw new InvalidParameterValueException("Projectid and accountId can't be specified together"); Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId);
ProjectVO project = _projectDao.findByProjectAccountId(account.getId()); s_logger.debug("Deleting project " + project + " as a part of domain id=" + domainId + " cleanup"); boolean deleteProject = _projectMgr.deleteProject(getCaller(), CallContext.current().getCallingUserId(), project); if (!deleteProject) { s_logger.warn("Failed to cleanup project " + project + " as a part of domain cleanup");
if (projectId.longValue() == -1) { if (!_accountMgr.isAdmin(caller.getId())) { permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by specified id"); if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) {
final Project project = _projectMgr.getProject(projectId); if (project != null) { if (!enabledOnly || project.getState() == Project.State.Active) {
throw new InvalidParameterValueException("accountName and projectId are mutually exclusive"); final Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId);
Project project = _projectMgr.getProject(projectId); if (project == null) { throwInvalidIdException("Unable to find project by id " + projectId, projectId.toString(), "projectId");
throw new InvalidParameterValueException("Account and projectId are mutually exclusive"); final Project project = _projectMgr.getProject(projectId); if (project == null) { throw new InvalidParameterValueException("Unable to find project by id " + projectId);
final Project project = _projectMgr.getProject(projectId); if (project == null) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project by id " + projectId);