diff --git a/docs/dev-guide/xlang/xmeta.md b/docs/dev-guide/xlang/xmeta.md index 4084e2b09..8a974b636 100644 --- a/docs/dev-guide/xlang/xmeta.md +++ b/docs/dev-guide/xlang/xmeta.md @@ -144,7 +144,7 @@ NopGraphQL引擎返回的对象信息完全由XMeta来定义。如果一个属 实体模型中的关联对象生成到XMeta模型中体现为如下配置 -``` +```xml diff --git a/docs/tutorial/simple/4-complex-query.md b/docs/tutorial/simple/4-complex-query.md index 0042fc64b..94fee1890 100644 --- a/docs/tutorial/simple/4-complex-query.md +++ b/docs/tutorial/simple/4-complex-query.md @@ -210,7 +210,7 @@ query($filter1:Map, $filter2: Map){ 可以在XMeta中增加一个自定义字段,然后通过`graphql:transFilter`将自定义字段条件翻译为子表查询条件所对应的SQL语句。 具体实现原理是利用QueryBean提供的transformFilter函数,对前台提交的查询条件进行结构变换, -例如对于`/r/NopAuthSite__findPage?filter__myCustomFilter=main`这种自定义查询条件, +例如对于`/r/NopAuthSite__findPage?filter__myCustomFilter=1`这种自定义查询条件, 我们在XMeta中通过prop节点的`graphql:transFilter`子节点配置来定义转换逻辑。 ```xml @@ -236,7 +236,7 @@ select o from NopAuthSite o where exists( select o2 from NopAuthResource o2 where o2.siteId= o.id - and o2.status >= 'main' + and o2.status >= 1 ) ``` diff --git a/nop-biz/src/main/java/io/nop/biz/crud/ObjMetaBasedValidator.java b/nop-biz/src/main/java/io/nop/biz/crud/ObjMetaBasedValidator.java index cbe3fdc01..9394e2b64 100644 --- a/nop-biz/src/main/java/io/nop/biz/crud/ObjMetaBasedValidator.java +++ b/nop-biz/src/main/java/io/nop/biz/crud/ObjMetaBasedValidator.java @@ -246,6 +246,10 @@ private void doCheckAuth(String objTypeName, IObjPropMeta propMeta, ActionAuthMe if (authChecker == null || auth == null) return; + // 如果是公开方法,则不检查用户权限 + if (auth.isPublicAccess()) + return; + if (auth.getRoles() != null && !auth.getRoles().isEmpty()) { if (this.context.getUserContext().isUserInAnyRole(auth.getRoles())) return; @@ -416,4 +420,4 @@ public Map validateForSelection(Map data, String return validateAndConvert(data, selectionMeta.getMapping(), (propMeta, sel, subTable) -> sel.hasField(propMeta.getName())); } -} \ No newline at end of file +} diff --git a/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/obj-schema.xdef b/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/obj-schema.xdef index 57ed50ead..c103a5277 100644 --- a/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/obj-schema.xdef +++ b/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/obj-schema.xdef @@ -56,7 +56,8 @@ ui:editGrid="string" ui:viewGrid="string" ui:maskPattern="string" ui:shortcuts="string" orm:manyToManyRefProp="string" xml:mapper="string" graphql:mapper="string" biz:codeRule="string" graphql:datePattern="string" - graphql:type="string" graphql:jsonComponentProp="string" graphql:dictValueProp="prop-path" + graphql:type="string" graphql:jsonComponentProp="string" + graphql:dictName="string" graphql:dictValueProp="prop-path" graphql:joinLeftProps="word-set" graphql:joinRightProps="word-set" graphql:connectionProp="prop-name" graphql:maxFetchSize="int" graphql:queryMethod="dict:core/std-query-method" graphql:authObjName="string" @@ -128,4 +129,4 @@ - \ No newline at end of file + diff --git a/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/schema.xdef b/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/schema.xdef index 22181bbe0..aaba6ab76 100644 --- a/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/schema.xdef +++ b/nop-xdefs/src/main/resources/_vfs/nop/schema/schema/schema.xdef @@ -75,7 +75,8 @@ ui:editGrid="string" ui:viewGrid="string" ui:maskPattern="string" orm:manyToManyRefProp="string" xml:mapper="string" graphql:mapper="string" biz:codeRule="string" graphql:datePattern="string" - graphql:type="string" graphql:jsonComponentProp="string" graphql:dictValueProp="prop-path" + graphql:type="string" graphql:jsonComponentProp="string" + graphql:dictName="string" graphql:dictValueProp="prop-path" graphql:joinLeftProps="word-set" graphql:joinRightProps="word-set" graphql:connectionProp="prop-name" graphql:maxFetchSize="int" graphql:queryMethod="dict:core/std-query-method" graphql:authObjName="string" @@ -143,4 +144,4 @@ - \ No newline at end of file + diff --git a/nop-xlang/src/main/resources/_vfs/dict/core/std-domain.dict.yaml b/nop-xlang/src/main/resources/_vfs/dict/core/std-domain.dict.yaml index 38565f729..cfbf69189 100644 --- a/nop-xlang/src/main/resources/_vfs/dict/core/std-domain.dict.yaml +++ b/nop-xlang/src/main/resources/_vfs/dict/core/std-domain.dict.yaml @@ -93,7 +93,7 @@ options: - value: conf-name label: 配置变量名 - description: 配置变量名,由英文字母、数字、下划线、字符-和.构成,不包含下划线、$等特殊字符 + description: 配置变量名,由英文字母、数字、下划线、字符-和.构成,不包含$等特殊字符 - value: url label: 网页URL