j***@163.com
j***@163.com
  • 发布:2023-10-09 12:38
  • 更新:2023-10-09 13:40
  • 阅读:146

权限校验未通过,参与权限校验的集合

分类:uniCloud

schema2code代码生成系统
新增数据表opendb-nation-china.schema.json

{  
  "schema": {  
    "bsonType": "object",  
    "required": ["name"],  
    "permission": {  
      "read": true,  
        "create": false,  
        "update": false,  
        "delete": false  
    },  
    "properties": {  
      "_id": {  
        "description": "ID,系统自动生成"  
      },  
      "name": {  
        "bsonType": "string",  
        "description": "民族名称"  
      },  
      "first_letter": {  
        "bsonType": "string",  
        "description": "拼音首字母"  
      }  
    }  
  },  
  "index": [{  
      "IndexName": "name",  
      "MgoKeySchema": {  
        "MgoIndexKeys": [{  
          "Name": "name",  
          "Direction": "1"  
        }],  
        "MgoIsUnique": false  
      }  
    },  
    {  
      "IndexName": "sort",  
      "MgoKeySchema": {  
        "MgoIndexKeys": [{  
          "Name": "sort",  
          "Direction": "1"  
        }],  
        "MgoIsUnique": false  
      }  
    },  
    {  
      "IndexName": "first_letter",  
      "MgoKeySchema": {  
        "MgoIndexKeys": [{  
          "Name": "first_letter",  
          "Direction": "1"  
        }],  
        "MgoIsUnique": false  
      }  
    }  
  ]  
}

代码生成后,出现如下错误

请求代码如下
{"method":"serverless.function.runtime.invoke","params":"{\"functionTarget\":\"DCloud-clientDB\",\"functionArgs\":{\"command\":{\"$db\":[{\"$method\":\"collection\",\"$param\":[\"opendb-nation-china\"]},{\"$method\":\"field\",\"$param\":[\"name as value, name as text\"]},{\"$method\":\"orderBy\",\"$param\":[\"first_letter asc\"]},{\"$method\":\"skip\",\"$param\":[0]},{\"$method\":\"limit\",\"$param\":[500]},{\"$method\":\"get\",\"$param\":[{\"getCount\":false,\"getTree\":false}]}]},\"clientInfo\":{\"PLATFORM\":\"web\",\"OS\":\"windows\",\"APPID\":\"UNIF452AA8\",\"DEVICEID\":\"16962582192751558466\",\"scene\":1001,\"appId\":\"UNIF452AA8\",\"appLanguage\":\"zh-Hans\",\"appName\":\"优佳\",\"appVersion\":\"\",\"appVersionCode\":\"100\",\"browserName\":\"chrome\",\"browserVersion\":\"117.0.0.0\",\"deviceId\":\"16962582192751558466\",\"deviceModel\":\"PC\",\"deviceOrientation\":\"portrait\",\"devicePixelRatio\":1,\"deviceType\":\"pc\",\"hostLanguage\":\"zh-CN\",\"hostName\":\"chrome\",\"hostTheme\":\"light\",\"hostVersion\":\"117.0.0.0\",\"osName\":\"windows\",\"osVersion\":\"10 x64\",\"safeArea\":{\"left\":0,\"right\":861,\"top\":0,\"bottom\":926,\"width\":861,\"height\":926},\"safeAreaInsets\":{\"top\":0,\"right\":0,\"bottom\":0,\"left\":0},\"screenHeight\":1080,\"screenWidth\":1920,\"statusBarHeight\":0,\"ua\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36\",\"uniCompileVersion\":\"3.8.7\",\"uniPlatform\":\"web\",\"uniRuntimeVersion\":\"3.8.7\",\"windowBottom\":0,\"windowHeight\":926,\"windowTop\":0,\"windowWidth\":861,\"locale\":\"zh-Hans\",\"LOCALE\":\"zh-Hans\"},\"uniIdToken\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiI2NTFlZDI1NThiMGRhNGNhMDgyYjM4NDUiLCJyb2xlIjpbXSwicGVybWlzc2lvbiI6W10sInVuaUlkVmVyc2lvbiI6IjEuMC4xNiIsImlhdCI6MTY5NjgyMjY2NiwiZXhwIjoxNjk2ODI5ODY2fQ.EAG6rLQYk7cRaMyBXdHcyCuenAUt2TIW3_AHBV2ugT8\"}}","spaceId":"mp-b4e272d3-d124-4325-ade0-e78eabdae81b","timestamp":1696824354224,"token":"f46fa9f5-f85d-4ecf-9346-b7060986619d"}

2023-10-09 12:38 负责人:无 分享
已邀请:
j***@163.com

j***@163.com (作者)

我醉了,
数据表opendb-nation-china.schema.json权限部分如此改动一下,测试好使,再改回去也好使,这什么情况
"permission": {
"read":"auth.uid == 'abc'",
"create": false,
"update": false,
"delete": false
},

要回复问题请先登录注册