|
@@ -34,6 +34,8 @@ public class UserContext implements BaseModel{
|
|
|
|
|
|
private List<MgrOrganization> organizationList;
|
|
|
|
|
|
+ private List<MgrOrganization> workarkOrganizationList;
|
|
|
+
|
|
|
private long organizationId;
|
|
|
|
|
|
private long projectId;
|
|
@@ -45,9 +47,13 @@ public class UserContext implements BaseModel{
|
|
|
private String roleName;
|
|
|
|
|
|
private MgrOrganization organization;
|
|
|
-
|
|
|
+
|
|
|
+ private MgrOrganization workarkOrganization;
|
|
|
+
|
|
|
private MgrUserRole userRole;
|
|
|
-
|
|
|
+
|
|
|
+ private MgrUserRole workarkUserRole;
|
|
|
+
|
|
|
private String resource;
|
|
|
|
|
|
private String menu;
|
|
@@ -124,6 +130,14 @@ public class UserContext implements BaseModel{
|
|
|
this.organization = organization;
|
|
|
}
|
|
|
|
|
|
+ public MgrOrganization getWorkarkOrganization() {
|
|
|
+ return workarkOrganization;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setWorkarkOrganization(MgrOrganization workarkOrganization) {
|
|
|
+ this.workarkOrganization = workarkOrganization;
|
|
|
+ }
|
|
|
+
|
|
|
public String getResource() {
|
|
|
return resource;
|
|
|
}
|
|
@@ -171,7 +185,15 @@ public class UserContext implements BaseModel{
|
|
|
public void setOrganizationList(List<MgrOrganization> organizationList) {
|
|
|
this.organizationList = organizationList;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ public List<MgrOrganization> getWorkarkOrganizationList() {
|
|
|
+ return workarkOrganizationList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setWorkarkOrganizationList(List<MgrOrganization> workarkOrganizationList) {
|
|
|
+ this.workarkOrganizationList = workarkOrganizationList;
|
|
|
+ }
|
|
|
+
|
|
|
public MgrUserRole getUserRole() {
|
|
|
return userRole;
|
|
|
}
|
|
@@ -179,7 +201,15 @@ public class UserContext implements BaseModel{
|
|
|
public void setUserRole(MgrUserRole userRole) {
|
|
|
this.userRole = userRole;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ public MgrUserRole getWorkarkUserRole() {
|
|
|
+ return workarkUserRole;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setWorkarkUserRole(MgrUserRole workarkUserRole) {
|
|
|
+ this.workarkUserRole = workarkUserRole;
|
|
|
+ }
|
|
|
+
|
|
|
public String getSex() {
|
|
|
return sex;
|
|
|
}
|
|
@@ -279,7 +309,7 @@ public class UserContext implements BaseModel{
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public static UserContext getUserContext(MgrUser user, List<MgrOrganization> organizationList, MgrOrganization currentOrganization, MgrUserRole userRole, Map<Long, Set<JSONObject>> projectListIdentity) {
|
|
|
+ public static UserContext getUserContext(MgrUser user, List<MgrOrganization> workarkOrganizationList, List<MgrOrganization> organizationList, MgrOrganization workarkCurrentOrganization, MgrOrganization currentOrganization, MgrUserRole workarkCurrentUserRole, MgrUserRole userRole, Map<Long, Set<JSONObject>> projectListIdentity) {
|
|
|
if (user != null) {
|
|
|
UserContext flowUser = new UserContext();
|
|
|
flowUser.setUserId(user.getId());
|
|
@@ -296,7 +326,9 @@ public class UserContext implements BaseModel{
|
|
|
flowUser.setProjectId(user.getLastProjectId());
|
|
|
flowUser.setIdentityId(user.getLastIdentityId());
|
|
|
flowUser.setOrganization(currentOrganization);
|
|
|
+ flowUser.setWorkarkOrganization(workarkCurrentOrganization);
|
|
|
flowUser.setOrganizationList(organizationList);
|
|
|
+ flowUser.setWorkarkOrganizationList(workarkOrganizationList);
|
|
|
if (currentOrganization != null) {
|
|
|
flowUser.setOrganizationId(currentOrganization.getId());
|
|
|
} else {
|
|
@@ -306,12 +338,16 @@ public class UserContext implements BaseModel{
|
|
|
flowUser.setAdmin(userRole.isAdmin());
|
|
|
flowUser.setMenu(userRole.getMenus());
|
|
|
flowUser.setResource(userRole.getResources());
|
|
|
-
|
|
|
- flowUser.setWorkarkMenu(userRole.getWorkarkMenus());
|
|
|
- flowUser.setWorkarkResource(userRole.getWorkarkResources());
|
|
|
}
|
|
|
flowUser.setUserRole(userRole);
|
|
|
|
|
|
+ if(workarkCurrentUserRole != null){
|
|
|
+ flowUser.setAdmin(workarkCurrentUserRole.isAdmin());
|
|
|
+ flowUser.setWorkarkMenu(workarkCurrentUserRole.getWorkarkMenus());
|
|
|
+ flowUser.setWorkarkResource(workarkCurrentUserRole.getWorkarkResources());
|
|
|
+ }
|
|
|
+ flowUser.setWorkarkUserRole(workarkCurrentUserRole);
|
|
|
+
|
|
|
flowUser.setProjectListIdentity(projectListIdentity);
|
|
|
return flowUser;
|
|
|
}
|