mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-02-25 23:05:06 +08:00
code better
This commit is contained in:
parent
1a6ee5129e
commit
189a6d6894
2 changed files with 9 additions and 9 deletions
|
@ -57,8 +57,8 @@ public class FieldAggregation implements TriggerAction {
|
|||
private static final int MAX_DEPTH = 5;
|
||||
|
||||
// 当前操作用户可能对目标实体/记录无更新权限
|
||||
// 允许无权限更新目标实体
|
||||
private static final boolean ALLOW_NOPRIVILEGES_UPDATE = true;
|
||||
// 此处标识是否允许无权限更新目标实体
|
||||
private static final boolean ALLOW_NOPERMISSION_UPDATE = true;
|
||||
|
||||
final private ActionContext context;
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class FieldAggregation implements TriggerAction {
|
|||
}
|
||||
|
||||
// 如果当前用户对目标记录无修改权限
|
||||
if (!ALLOW_NOPRIVILEGES_UPDATE) {
|
||||
if (!ALLOW_NOPERMISSION_UPDATE) {
|
||||
if (!Application.getSecurityManager().allowed(
|
||||
operatingContext.getOperator(), targetRecordId, BizzPermission.UPDATE)) {
|
||||
LOG.warn("No privileges to update record of target: " + this.targetRecordId);
|
||||
|
@ -141,8 +141,9 @@ public class FieldAggregation implements TriggerAction {
|
|||
}
|
||||
|
||||
if (targetRecord.getAvailableFieldIterator().hasNext()) {
|
||||
if (ALLOW_NOPRIVILEGES_UPDATE) {
|
||||
if (ALLOW_NOPERMISSION_UPDATE) {
|
||||
PrivilegesGuardInterceptor.setNoPrivilegesUpdateOnce(targetRecordId);
|
||||
LOG.warn("Allow no permission updates : " + targetRecordId);
|
||||
}
|
||||
Application.getEntityService(targetEntity.getEntityCode()).update(targetRecord);
|
||||
CALL_CHAIN_DEPTH.set(depth + 1);
|
||||
|
|
|
@ -18,10 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
|
||||
package com.rebuild.server.business.trigger.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.devezhao.persist4j.engine.ID;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
|
@ -34,7 +31,9 @@ import com.rebuild.server.service.bizz.UserHelper;
|
|||
import com.rebuild.server.service.notification.Message;
|
||||
import com.rebuild.server.service.notification.MessageBuilder;
|
||||
|
||||
import cn.devezhao.persist4j.engine.ID;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author devezhao zhaofang123@gmail.com
|
||||
|
|
Loading…
Reference in a new issue