diff --git a/.travis.yml b/.travis.yml index c4790edf4b0..4301d7569cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,6 +93,7 @@ env: smoke/misc/test_vm_sync" - TESTS="component/find_hosts_for_migration + component/test_accounts component/test_acl_isolatednetwork_delete component/test_acl_listsnapshot component/test_acl_listvm @@ -146,7 +147,6 @@ env: # - TESTS="component/test_project_resources" # - TESTS="component/test_cpu_domain_limits" # - TESTS="component/test_acl_isolatednetwork" -# - TESTS="component/test_accounts" # - TESTS="component/test_organization_states" before_install: travis_wait 30 ./tools/travis/before_install.sh diff --git a/api/src/com/cloud/user/User.java b/api/src/com/cloud/user/User.java index 0ecdcfa58d4..c3ac66c6979 100644 --- a/api/src/com/cloud/user/User.java +++ b/api/src/com/cloud/user/User.java @@ -22,8 +22,9 @@ import org.apache.cloudstack.api.InternalIdentity; public interface User extends OwnedBy, InternalIdentity { + // UNKNOWN and NATIVE can be used interchangeably public enum Source { - LDAP, SAML2, SAML2DISABLED, UNKNOWN + LDAP, SAML2, SAML2DISABLED, UNKNOWN, NATIVE } public static final long UID_SYSTEM = 1; diff --git a/api/src/org/apache/cloudstack/api/response/UserResponse.java b/api/src/org/apache/cloudstack/api/response/UserResponse.java index d96f632f1a3..dd10510c03c 100644 --- a/api/src/org/apache/cloudstack/api/response/UserResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UserResponse.java @@ -66,6 +66,10 @@ public class UserResponse extends BaseResponse { @Param(description = "the account type of the user") private Short accountType; + @SerializedName("usersource") + @Param(description = "the source type of the user in lowercase, such as native, ldap, saml2") + private String userSource; + @SerializedName(ApiConstants.ROLE_ID) @Param(description = "the ID of the role") private String roleId; @@ -260,4 +264,15 @@ public class UserResponse extends BaseResponse { public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } + + public String getUserSource() { + return userSource; + } + + public void setUserSource(User.Source userSource) { + this.userSource = userSource.toString().toLowerCase(); + if (this.userSource.equals(User.Source.UNKNOWN.toString().toLowerCase())) { + this.userSource = User.Source.NATIVE.toString().toLowerCase(); + } + } } diff --git a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java index 433912bff28..8d06bcd0a26 100644 --- a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java @@ -58,6 +58,7 @@ public class UserAccountJoinDaoImpl extends GenericDaoBase