mirror of https://github.com/apache/cloudstack.git
Project "Owner" is called project "Admin"
This commit is contained in:
parent
85d9de58d6
commit
45b058a89d
|
|
@ -45,7 +45,7 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the project")
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will be Admin for the project")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.cloud.api.ApiConstants;
|
|||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
|
|
@ -48,7 +47,7 @@ public class UpdateProjectCmd extends BaseAsyncCmd {
|
|||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new account who will own the project, should be specified with domainId")
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new Admin account for the project, should be specified with domainId")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="display text of the project")
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.cloud.projects;
|
|||
|
||||
|
||||
public interface ProjectAccount {
|
||||
public enum Role {Owner, Regular};
|
||||
public enum Role {Admin, Regular};
|
||||
|
||||
long getAccountId();
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
|
|||
Project project = _projectDao.persist(new ProjectVO(name, displayText, owner.getDomainId(), projectAccount.getId()));
|
||||
|
||||
//assign owner to the project
|
||||
assignAccountToProject(project, owner.getId(), ProjectAccount.Role.Owner);
|
||||
assignAccountToProject(project, owner.getId(), ProjectAccount.Role.Admin);
|
||||
|
||||
if (project != null) {
|
||||
UserContext.current().setEventDetails("Project id=" + project.getId());
|
||||
|
|
@ -504,7 +504,7 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
|
|||
_projectAccountDao.update(currentOwner.getId(), currentOwner);
|
||||
|
||||
//set new owner
|
||||
futureOwner.setAccountRole(Role.Owner);
|
||||
futureOwner.setAccountRole(Role.Admin);
|
||||
_projectAccountDao.update(futureOwner.getId(), futureOwner);
|
||||
|
||||
} else {
|
||||
|
|
@ -616,7 +616,7 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
|
|||
}
|
||||
|
||||
//can't remove the owner of the project
|
||||
if (projectAccount.getAccountRole() == Role.Owner) {
|
||||
if (projectAccount.getAccountRole() == Role.Admin) {
|
||||
throw new InvalidParameterValueException("Unable to delete account " + accountName + " from the project id=" + projectId + " as the account is the owner of the project");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class ProjectAccountDaoImpl extends GenericDaoBase<ProjectAccountVO, Long
|
|||
@Override
|
||||
public ProjectAccountVO getProjectOwner(long projectId) {
|
||||
SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("role", ProjectAccount.Role.Owner);
|
||||
sc.setParameters("role", ProjectAccount.Role.Admin);
|
||||
sc.setParameters("projectId", projectId);
|
||||
|
||||
return findOneBy(sc);
|
||||
|
|
@ -88,7 +88,7 @@ public class ProjectAccountDaoImpl extends GenericDaoBase<ProjectAccountVO, Long
|
|||
SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("accountId", accountId);
|
||||
sc.setParameters("projectAccountId", projectAccountId);
|
||||
sc.setParameters("role", ProjectAccount.Role.Owner);
|
||||
sc.setParameters("role", ProjectAccount.Role.Admin);
|
||||
|
||||
if (findOneBy(sc) != null) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue