diff --git a/avni-server-api/src/main/java/org/avni/server/web/UserInfoWebController.java b/avni-server-api/src/main/java/org/avni/server/web/UserInfoWebController.java index 9cb776304..e724aff45 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/UserInfoWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/UserInfoWebController.java @@ -64,7 +64,7 @@ public UserInfoWebResponse getUserInfo() { user.getSyncSettings(), groupPrivilegeResponses, user.hasAllPrivileges(), - lastSessionTime); + lastSessionTime, + contextOrganisation.getCategory()); } - } diff --git a/avni-server-api/src/main/java/org/avni/server/web/response/UserInfoWebResponse.java b/avni-server-api/src/main/java/org/avni/server/web/response/UserInfoWebResponse.java index 380e4ac30..b6ef1e244 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/response/UserInfoWebResponse.java +++ b/avni-server-api/src/main/java/org/avni/server/web/response/UserInfoWebResponse.java @@ -3,11 +3,13 @@ import org.avni.server.domain.JsonObject; import org.avni.server.domain.Organisation; import org.avni.server.domain.User; +import org.avni.server.domain.metadata.OrganisationCategory; import org.avni.server.web.request.UserInfoContract; import java.util.List; public class UserInfoWebResponse extends UserInfoContract { + private OrganisationCategory organisationCategory; private long lastSessionTime; private boolean hasAllPrivileges; private List privileges; @@ -27,15 +29,17 @@ public static UserInfoWebResponse createForAdminUser(List privileges, boolean hasAllPrivileges, long lastSessionTime) { + public UserInfoWebResponse(String username, String orgName, Long orgId, String usernameSuffix, JsonObject settings, String name, String catchmentName, JsonObject syncSettings, List privileges, boolean hasAllPrivileges, long lastSessionTime, OrganisationCategory organisationCategory) { super(username, orgName, orgId, usernameSuffix, settings, name, catchmentName, syncSettings); this.privileges = privileges; this.hasAllPrivileges = hasAllPrivileges; this.lastSessionTime = lastSessionTime; + this.organisationCategory = organisationCategory; } public List getPrivileges() { @@ -57,4 +61,8 @@ public long getLastSessionTime() { public void setLastSessionTime(long lastSessionTime) { this.lastSessionTime = lastSessionTime; } + + public OrganisationCategory getOrganisationCategory() { + return organisationCategory; + } }