【发布时间】:2021-01-18 03:00:19
【问题描述】:
我正在尝试根据these instructions 在 KeystoneJS 中应用字段级访问逻辑。
以下内容在管理 UI 中隐藏了一个字段 fieldName:
fieldName: {
type: Text,
access: {
read: false,
update: false,
create: false
},
},
但如果我使用imperative approach,则该字段不会从管理 UI 中隐藏。见下文,我希望它产生与上述静态方法相同的结果:
fieldName: {
type: Text,
access: {
read: ({ authentication: { item, listKey } }) => {
return false;
},
update: ({ authentication: { item, listKey } }) => {
return false;
},
create: ({ authentication: { item, listKey } }) => {
return false;
}
},
},
是我遗漏了什么还是这是一个错误?
【问题讨论】:
标签: javascript node.js keystonejs