提交 ea727bad 编写于 作者: O o2null

Merge branch 'feature/#253' into 'develop'

登录页面单独进行判断

See merge request o2oa/o2oa!1291
......@@ -26,7 +26,7 @@ class ActionGet extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(page.getPortal());
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -26,7 +26,7 @@ class ActionGetMobile extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(page.getPortal());
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -27,16 +27,16 @@ class ActionGetWithPortal extends BaseAction {
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
Portal portal = business.portal().pick(wo.getPortal());
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
} else {
Portal portal = business.portal().pick(portalFlag);
Portal portal = business.portal().pick(portalFlag);
if (null == portal) {
throw new ExceptionPortalNotExist(portalFlag);
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -27,7 +27,7 @@ class ActionGetWithPortalMobile extends BaseAction {
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
Portal portal = business.portal().pick(wo.getPortal());
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......@@ -36,7 +36,7 @@ class ActionGetWithPortalMobile extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(portalFlag);
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
package com.x.portal.assemble.surface.jaxrs.page;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.portal.core.entity.Page;
......@@ -10,4 +13,9 @@ abstract class BaseAction extends StandardJaxrsAction {
Ehcache pageCache = ApplicationCache.instance().getCache(Page.class);
protected boolean isNotLoginPage(String id) throws Exception {
return !(Config.portal().getIndexPage().getEnable()
&& StringUtils.equals(id, Config.portal().getIndexPage().getPage()));
}
}
......@@ -26,7 +26,7 @@ class ActionGet extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(page.getPortal());
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -26,7 +26,7 @@ class ActionGetMobile extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(page.getPortal());
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -27,16 +27,16 @@ class ActionGetWithPortal extends BaseAction {
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
Portal portal = business.portal().pick(wo.getPortal());
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
} else {
Portal portal = business.portal().pick(portalFlag);
Portal portal = business.portal().pick(portalFlag);
if (null == portal) {
throw new ExceptionPortalNotExist(portalFlag);
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
......@@ -27,7 +27,7 @@ class ActionGetWithPortalMobile extends BaseAction {
if ((null != element) && (null != element.getObjectValue())) {
wo = (Wo) element.getObjectValue();
Portal portal = business.portal().pick(wo.getPortal());
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......@@ -36,7 +36,7 @@ class ActionGetWithPortalMobile extends BaseAction {
if (null == portal) {
throw new ExceptionPortalNotExist(portalFlag);
}
if (!business.portal().visible(effectivePerson, portal)) {
if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
portal.getId());
}
......
package com.x.portal.assemble.surface.jaxrs.page;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.portal.core.entity.Page;
......@@ -10,4 +13,9 @@ abstract class BaseAction extends StandardJaxrsAction {
Ehcache pageCache = ApplicationCache.instance().getCache(Page.class);
protected boolean isNotLoginPage(String id) throws Exception {
return !(Config.portal().getIndexPage().getEnable()
&& StringUtils.equals(id, Config.portal().getIndexPage().getPage()));
}
}
......@@ -25,9 +25,9 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import javax.servlet.http.HttpServletRequest;
class ActionUpload extends BaseAction {
class ActionUploadWithWork extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionUpload.class);
private static Logger logger = LoggerFactory.getLogger(ActionUploadWithWork.class);
ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, String site, String fileName, byte[] bytes,
FormDataContentDisposition disposition, String extraParam) throws Exception {
......
......@@ -364,7 +364,7 @@ public class AttachmentAction extends StandardJaxrsAction {
asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
@JaxrsMethodDescribe(value = "上传附件.", action = ActionUpload.class)
@JaxrsMethodDescribe(value = "上传附件.", action = ActionUploadWithWork.class)
@POST
@Path("upload/work/{workId}")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
......@@ -376,7 +376,7 @@ public class AttachmentAction extends StandardJaxrsAction {
@JaxrsParameterDescribe("天印扩展字段") @FormDataParam("extraParam") String extraParam,
@FormDataParam(FILE_FIELD) byte[] bytes,
@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
ActionResult<ActionUpload.Wo> result = new ActionResult<>();
ActionResult<ActionUploadWithWork.Wo> result = new ActionResult<>();
EffectivePerson effectivePerson = this.effectivePerson(request);
try {
if (StringUtils.isEmpty(extraParam)) {
......@@ -392,7 +392,7 @@ public class AttachmentAction extends StandardJaxrsAction {
}
}
}
result = new ActionUpload().execute(effectivePerson, workId, site, fileName, bytes, disposition,
result = new ActionUploadWithWork().execute(effectivePerson, workId, site, fileName, bytes, disposition,
extraParam);
} catch (Exception e) {
logger.error(e, effectivePerson, request, null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册