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

Merge branch 'wrdp' into 'develop'

Wrdp

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