Преглед на файлове

修复附件查询权限问题

o2sword преди 5 години
родител
ревизия
655ed98b4f

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

@@ -43,13 +43,14 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 			Wo wo = Wo.copier.copy(attachment);
 
 			List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
-
 			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);