Skip to content

Commit

Permalink
meta中的prop缺省情况下修改为只读,需要显式设置insertable和updatable才允许新建和修改,避免无意中引入的prop产…
Browse files Browse the repository at this point in the history
…生安全问题
  • Loading branch information
entropy-cloud committed Jul 28, 2024
1 parent 8e285d9 commit 0229fc6
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_chgType,ROLE_ID,ROLE_NAME,CHILD_ROLE_IDS,IS_PRIMARY,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROLE_ID,ROLE_NAME,CHILD_ROLE_IDS,IS_PRIMARY,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROLE_ID,ROLE_NAME,CHILD_ROLE_IDS,IS_PRIMARY,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROLE_ID,ROLE_NAME,CHILD_ROLE_IDS,IS_PRIMARY,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import io.nop.api.core.annotations.autotest.EnableSnapshot;
import io.nop.api.core.exceptions.ErrorCode;
import io.nop.api.core.util.Guard;
import io.nop.autotest.core.AutoTestCase;
import io.nop.autotest.core.data.AutoTestDataHelper;
import org.junit.jupiter.api.AfterEach;
Expand Down Expand Up @@ -104,7 +103,7 @@ protected void configExecutionMode(TestInfo testInfo) {
protected String getCaseDataPath(TestInfo testInfo) {
Class<?> testClass = testInfo.getTestClass().orElse(null);
Method testMethod = testInfo.getTestMethod().orElse(null);
if(testClass == null || testMethod == null)
if (testClass == null || testMethod == null)
throw new IllegalArgumentException("null test info");
return AutoTestDataHelper.getTestDataPath(testClass, testMethod);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
package io.nop.orm.model;

import io.nop.commons.type.StdDataType;
import io.nop.commons.util.StringHelper;
import io.nop.commons.type.StdSqlType;
import io.nop.commons.util.StringHelper;

import java.util.List;
import java.util.Objects;

public interface IColumnModel extends IEntityPropModel {

Expand All @@ -20,7 +21,10 @@ public interface IColumnModel extends IEntityPropModel {
String getDomain();

default String getBaseDomain() {
return StringHelper.firstPart(getDomain(), '-');
String domain = getDomain();
if (Objects.equals(domain, getStdDomain()))
return domain;
return StringHelper.firstPart(domain, '-');
}

String getStdDomain();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"data": {
"id": "@var:NopSysExtField@entityId",
"sid": "@var:NopSysExtField@entityId",
"name": "abc",
"displayName": "XXX",
"codePattern": "124",
"delFlag": 0,
"version": 0,
"createdBy": "autotest-ref",
"createTime": "@var:NopSysCodeRule@updateTime",
"createTime": "@var:NopSysExtField@updateTime",
"updatedBy": "autotest-ref",
"updateTime": "@var:NopSysCodeRule@updateTime",
"id": "@var:NopSysExtField@entityId",
"updateTime": "@var:NopSysExtField@updateTime",
"seqName": null,
"remark": null,
"extFldC": "xyz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="super" xmlns:biz="biz">
<props>
<prop name="extFldC" />
<prop name="extFldC" insertable="true" updatable="true"/>
</props>
</meta>

0 comments on commit 0229fc6

Please sign in to comment.