提交 845a1b2d 编写于 作者: O o2null

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!1820
......@@ -73,7 +73,7 @@ class ActionBatchDownloadWithWorkOrWorkCompleted extends BaseAction {
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
List<Attachment> readableAttachmentList = new ArrayList<>();
for (Attachment attachment : attachmentList) {
if (this.read(attachment, effectivePerson, identities, units)) {
if (this.read(attachment, effectivePerson, identities, units, business)) {
readableAttachmentList.add(attachment);
}
}
......
......@@ -73,7 +73,7 @@ class ActionBatchDownloadWithWorkOrWorkCompletedStream extends BaseAction {
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
List<Attachment> readableAttachmentList = new ArrayList<>();
for (Attachment attachment : attachmentList) {
if (this.read(attachment, effectivePerson, identities, units)) {
if (this.read(attachment, effectivePerson, identities, units, business)) {
readableAttachmentList.add(attachment);
}
}
......
......@@ -19,6 +19,8 @@ import com.x.processplatform.core.entity.content.Work;
import com.x.processplatform.core.entity.element.Application;
import com.x.processplatform.core.entity.element.Process;
import java.util.List;
class ActionChangeOrderNumber extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionChangeOrderNumber.class);
......@@ -41,9 +43,10 @@ class ActionChangeOrderNumber extends BaseAction {
if (BooleanUtils.isNotTrue(control.getAllowSave())) {
throw new ExceptionAccessDenied(effectivePerson, work);
}
Application application = business.application().pick(work.getApplication());
Process process = business.process().pick(work.getProcess());
if (!business.controllerable(effectivePerson, application, process, attachment)) {
List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
if(!canEdit){
throw new ExceptionAccessDenied(effectivePerson, attachment);
}
emc.beginTransaction(Attachment.class);
......
......@@ -14,6 +14,8 @@ import com.x.processplatform.assemble.surface.WorkControl;
import com.x.processplatform.core.entity.content.Attachment;
import com.x.processplatform.core.entity.content.Work;
import java.util.List;
class ActionChangeSite extends BaseAction {
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String workId, String site) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
......@@ -34,6 +36,12 @@ class ActionChangeSite extends BaseAction {
if (BooleanUtils.isNotTrue(control.getAllowSave())) {
throw new ExceptionAccessDenied(effectivePerson, work);
}
List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
if(!canEdit){
throw new ExceptionAccessDenied(effectivePerson, attachment);
}
emc.beginTransaction(Attachment.class);
attachment.setSite(site);
emc.commit();
......
......@@ -56,7 +56,7 @@ class ActionEdit extends BaseAction {
List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
boolean canControl = this.control(attachment, effectivePerson, identities, units);
boolean canControl = this.control(attachment, effectivePerson, identities, units, business);
if(!canControl){
throw new ExceptionAccessDenied(effectivePerson, attachment);
}
......
......@@ -14,7 +14,6 @@ import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.tools.ListTools;
import com.x.processplatform.assemble.surface.Business;
import com.x.processplatform.assemble.surface.jaxrs.attachment.ActionListWithWorkOrWorkCompleted.Wo;
import com.x.processplatform.core.entity.content.Attachment;
import com.x.processplatform.core.entity.content.Work;
......@@ -43,9 +42,9 @@ class ActionGetWithWork extends BaseAction {
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
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);
boolean canControl = this.control(attachment, effectivePerson, identities, units, business);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
boolean canRead = this.read(attachment, effectivePerson, identities, units, business);
if (canRead) {
wo.getControl().setAllowRead(true);
wo.getControl().setAllowEdit(canEdit);
......
......@@ -42,9 +42,9 @@ class ActionGetWithWorkCompleted extends BaseAction {
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
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);
boolean canControl = this.control(attachment, effectivePerson, identities, units, business);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
boolean canRead = this.read(attachment, effectivePerson, identities, units, business);
if (canRead) {
wo.getControl().setAllowRead(true);
wo.getControl().setAllowEdit(canEdit);
......
......@@ -44,9 +44,9 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
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);
boolean canControl = this.control(attachment, effectivePerson, identities, units, business);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
boolean canRead = this.read(attachment, effectivePerson, identities, units, business);
if (canRead) {
wo.getControl().setAllowRead(true);
wo.getControl().setAllowEdit(canEdit);
......
......@@ -46,9 +46,9 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
for (Attachment attachment : this.list(business, job)) {
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);
boolean canControl = this.control(attachment, effectivePerson, identities, units, business);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
boolean canRead = this.read(attachment, effectivePerson, identities, units, business);
if (canRead) {
wo.getControl().setAllowRead(true);
wo.getControl().setAllowEdit(canEdit);
......
......@@ -67,8 +67,7 @@ class ActionUpdate extends BaseAction {
List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
List<String> units = business.organization().unit().listWithPerson(effectivePerson);
boolean canControl = this.control(attachment, effectivePerson, identities, units);
boolean canEdit = (this.edit(attachment, effectivePerson, identities, units) || canControl);
boolean canEdit = this.edit(attachment, effectivePerson, identities, units, business);
if(!canEdit){
throw new ExceptionAccessDenied(effectivePerson, attachment);
}
......
......@@ -174,47 +174,39 @@ abstract class BaseAction extends StandardJaxrsAction {
}
public boolean read(Attachment attachment, EffectivePerson effectivePerson, List<String> identities,
List<String> units) throws Exception {
List<String> units, Business business) throws Exception {
boolean value = false;
if (effectivePerson.isManager()) {
value = true;
} else if (effectivePerson.isPerson(attachment.getPerson())) {
value = true;
} else if (ListTools.isEmpty(attachment.getReadIdentityList())
if (ListTools.isEmpty(attachment.getReadIdentityList())
&& ListTools.isEmpty(attachment.getReadUnitList())) {
value = true;
} else {
if (ListTools.containsAny(identities, attachment.getReadIdentityList())
}else if (ListTools.containsAny(identities, attachment.getReadIdentityList())
|| ListTools.containsAny(units, attachment.getReadUnitList())) {
value = true;
}
value = true;
}else{
value = this.edit(attachment, effectivePerson, identities, units, business);
}
return value;
}
public boolean edit(Attachment attachment, EffectivePerson effectivePerson, List<String> identities,
List<String> units) throws Exception {
List<String> units, Business business) throws Exception {
boolean value = false;
if (effectivePerson.isManager()) {
value = true;
} else if (effectivePerson.isPerson(attachment.getPerson())) {
value = true;
} else if (ListTools.isEmpty(attachment.getEditIdentityList())
if (ListTools.isEmpty(attachment.getEditIdentityList())
&& ListTools.isEmpty(attachment.getEditUnitList())) {
value = true;
} else {
if (ListTools.containsAny(identities, attachment.getEditIdentityList())
}else if (ListTools.containsAny(identities, attachment.getEditIdentityList())
|| ListTools.containsAny(units, attachment.getEditUnitList())) {
value = true;
}
value = true;
}else{
value = this.control(attachment, effectivePerson, identities, units, business);
}
return value;
}
public boolean control(Attachment attachment, EffectivePerson effectivePerson, List<String> identities,
List<String> units) throws Exception {
List<String> units, Business business) throws Exception {
boolean value = false;
if (effectivePerson.isManager()) {
if (business.canManageApplication(effectivePerson, null)) {
value = true;
} else if (effectivePerson.isPerson(attachment.getPerson())) {
value = true;
......
......@@ -1827,7 +1827,19 @@ o2.xDesktop.Default.Lnk = new Class({
setEvent: function(){
this.node.addEvents({
"click": function(){
layout.openApplication(null, this.data.name, this.data.options);
if (this.data.name=="Homepage"){
var name = this.data.name;
var options = this.data.options;
if (layout.config.indexPage && layout.config.indexPage.enable && layout.config.indexPage.portal){
name = "portal.Portal";
var appId = "portal.Portal"+layout.config.indexPage.portal;
options = {"name": "portal.Portal", "portalId": layout.config.indexPage.portal, "pageId": layout.config.indexPage.page, "appId": appId};
}
layout.openApplication(null, name, options);
}else{
layout.openApplication(null, this.data.name, this.data.options);
}
}.bind(this),
"mouseover": function(){
this.actionNode.fade("in");
......
......@@ -13,8 +13,9 @@ MWF.xApplication.LogViewer.Main = new Class({
onQueryLoad: function(){
this.lp = MWF.xApplication.LogViewer.LP;
this.tagId = o2.uuid();
},
onQueryClose: function () {
$clear(this.timeDo);
},
loadApplication: function(callback){
if (!this.options.isRefresh){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册