提交 5dcd4b4d 编写于 作者: O o2sword

修复附件查询权限问题

上级 56bbb4db
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册