Эх сурвалжийг харах

修复附件查询权限问题

o2sword 5 жил өмнө
parent
commit
5dcd4b4daa

+ 6 - 3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionGetWithWork.java

@@ -43,10 +43,13 @@ class ActionGetWithWork extends BaseAction {
 
 			List<String> units = business.organization().unit().listWithPerson(effectivePerson);
 
-			if (this.read(wo, effectivePerson, identities, units)) {
+			boolean canControl = this.control(wo, effectivePerson, identities, units);
+			boolean canEdit = (this.edit(wo, effectivePerson, identities, units) || canControl);
+			boolean canRead = (this.read(attachment, effectivePerson, identities, units) || canEdit);
+			if (canRead) {
 				wo.getControl().setAllowRead(true);
-				wo.getControl().setAllowEdit(this.edit(wo, effectivePerson, identities, units));
-				wo.getControl().setAllowControl(this.control(wo, effectivePerson, identities, units));
+				wo.getControl().setAllowEdit(canEdit);
+				wo.getControl().setAllowControl(canControl);
 			}
 
 			result.setData(wo);

+ 6 - 3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionGetWithWorkCompleted.java

@@ -42,10 +42,13 @@ class ActionGetWithWorkCompleted extends BaseAction {
 
 			List<String> units = business.organization().unit().listWithPerson(effectivePerson);
 
-			if (this.read(wo, effectivePerson, identities, units)) {
+			boolean canControl = this.control(wo, effectivePerson, identities, units);
+			boolean canEdit = (this.edit(wo, effectivePerson, identities, units) || canControl);
+			boolean canRead = (this.read(attachment, effectivePerson, identities, units) || canEdit);
+			if (canRead) {
 				wo.getControl().setAllowRead(true);
-				wo.getControl().setAllowEdit(this.edit(wo, effectivePerson, identities, units));
-				wo.getControl().setAllowControl(this.control(wo, effectivePerson, identities, units));
+				wo.getControl().setAllowEdit(canEdit);
+				wo.getControl().setAllowControl(canControl);
 			}
 
 			result.setData(wo);

+ 7 - 4
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java

@@ -45,11 +45,14 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 			List<Wo> wos = new ArrayList<>();
 
 			for (Attachment attachment : this.list(business, job)) {
-				if (this.read(attachment, effectivePerson, identities, units)) {
-					Wo wo = Wo.copier.copy(attachment);
+				Wo wo = Wo.copier.copy(attachment);
+				boolean canControl = this.control(wo, effectivePerson, identities, units);
+				boolean canEdit = (this.edit(wo, effectivePerson, identities, units) || canControl);
+				boolean canRead = (this.read(attachment, effectivePerson, identities, units) || canEdit);
+				if (canRead) {
 					wo.getControl().setAllowRead(true);
-					wo.getControl().setAllowEdit(this.edit(wo, effectivePerson, identities, units));
-					wo.getControl().setAllowControl(this.control(wo, effectivePerson, identities, units));
+					wo.getControl().setAllowEdit(canEdit);
+					wo.getControl().setAllowControl(canControl);
 					wos.add(wo);
 				}
 			}