Skip to content

Commit 45b058a

Browse files
Alena ProkharchykAlena Prokharchyk
authored andcommitted
Project "Owner" is called project "Admin"
1 parent 85d9de5 commit 45b058a

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎api/src/com/cloud/api/commands/CreateProjectCmd.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
4545
//////////////// API parameters /////////////////////
4646
/////////////////////////////////////////////////////
4747

48-
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the project")
48+
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will be Admin for the project")
4949
private String accountName;
5050

5151
@IdentityMapper(entityTableName="domain")

‎api/src/com/cloud/api/commands/UpdateProjectCmd.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.cloud.api.BaseAsyncCmd;
2525
import com.cloud.api.BaseCmd;
2626
import com.cloud.api.IdentityMapper;
27-
import com.cloud.api.BaseCmd.CommandType;
2827
import com.cloud.api.Implementation;
2928
import com.cloud.api.Parameter;
3029
import com.cloud.api.ServerApiException;
@@ -48,7 +47,7 @@ public class UpdateProjectCmd extends BaseAsyncCmd {
4847
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
4948
private Long id;
5049

51-
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new account who will own the project, should be specified with domainId")
50+
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new Admin account for the project, should be specified with domainId")
5251
private String accountName;
5352

5453
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="display text of the project")

‎api/src/com/cloud/projects/ProjectAccount.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
public interface ProjectAccount {
5-
public enum Role {Owner, Regular};
5+
public enum Role {Admin, Regular};
66

77
long getAccountId();
88

‎server/src/com/cloud/projects/ProjectManagerImpl.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public Project createProject(String name, String displayText, String accountName
189189
Project project = _projectDao.persist(new ProjectVO(name, displayText, owner.getDomainId(), projectAccount.getId()));
190190

191191
//assign owner to the project
192-
assignAccountToProject(project, owner.getId(), ProjectAccount.Role.Owner);
192+
assignAccountToProject(project, owner.getId(), ProjectAccount.Role.Admin);
193193

194194
if (project != null) {
195195
UserContext.current().setEventDetails("Project id=" + project.getId());
@@ -504,7 +504,7 @@ public Project updateProject(long projectId, String displayText, String newOwner
504504
_projectAccountDao.update(currentOwner.getId(), currentOwner);
505505

506506
//set new owner
507-
futureOwner.setAccountRole(Role.Owner);
507+
futureOwner.setAccountRole(Role.Admin);
508508
_projectAccountDao.update(futureOwner.getId(), futureOwner);
509509

510510
} else {
@@ -616,7 +616,7 @@ public boolean deleteAccountFromProject(long projectId, String accountName) {
616616
}
617617

618618
//can't remove the owner of the project
619-
if (projectAccount.getAccountRole() == Role.Owner) {
619+
if (projectAccount.getAccountRole() == Role.Admin) {
620620
throw new InvalidParameterValueException("Unable to delete account " + accountName + " from the project id=" + projectId + " as the account is the owner of the project");
621621
}
622622

‎server/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected ProjectAccountDaoImpl() {
4747
@Override
4848
public ProjectAccountVO getProjectOwner(long projectId) {
4949
SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
50-
sc.setParameters("role", ProjectAccount.Role.Owner);
50+
sc.setParameters("role", ProjectAccount.Role.Admin);
5151
sc.setParameters("projectId", projectId);
5252

5353
return findOneBy(sc);
@@ -88,7 +88,7 @@ public boolean canModifyProjectAccount(long accountId, long projectAccountId) {
8888
SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
8989
sc.setParameters("accountId", accountId);
9090
sc.setParameters("projectAccountId", projectAccountId);
91-
sc.setParameters("role", ProjectAccount.Role.Owner);
91+
sc.setParameters("role", ProjectAccount.Role.Admin);
9292

9393
if (findOneBy(sc) != null) {
9494
return true;

0 commit comments

Comments
 (0)