node.js - 标准许可与 sails 许可

标签 node.js permissions sails.js

我已使用分配的条件创建了权限,但它始终会导致 404 未找到,表明没有允许的记录。从日志的输出中可以看出,criteria{ group: 1 },并且有一条记录 group = 1,因此应该返回一条记录,因为您可以看到 permissed.lenth 等于 0。有谁熟悉sails-permissions能否告知这是否正确?

日志输出

silly: PermissionPolicy: 1 permissions grant read on Issue for johnsmith
info: responsePolicy
silly: data [ { items: 
      [ { owner: 1,
          group: 1,
          id: 1,
          title: 'An important issue',
          open: true,
          createdAt: '2015-08-24T18:17:32.580Z',
          updatedAt: '2015-08-24T18:17:32.586Z' },
        { owner: 3,
          group: 2,
          id: 2,
          title: 'An issue belonging to another group',
          open: true,
          createdAt: '2015-08-24T18:17:32.582Z',
          updatedAt: '2015-08-24T18:17:32.582Z' } ],
     _pagination: { current: 1, limit: 30, items: 2, pages: 1 } } ]
silly: options undefined
silly: criteria! [ { where: { group: 1 },
     permission: 45,
     createdAt: '2015-08-24T18:10:36.891Z',
     updatedAt: '2015-08-24T18:10:36.891Z',
     id: 1 } ]
silly: permitted.length === 0

最佳答案

这是由自定义 find 蓝图重新格式化数据结构引起的,以添加分页元 { items: [], _pagination: {...}}。这与 sails-permissions 对查找蓝图的期望相冲突,查找蓝图是一个数组 []

关于node.js - 标准许可与 sails 许可,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32198437/

相关文章:

node.js - node-sass - sass_context_wrapper.h :8:10: fatal error: sass/context. h:没有这样的文件或目录

javascript - Node 请求IP地址与远程IP地址不同

android - Cordova Android 应用程序和用户权限

permissions - 检查用户是否有查看页面的权限

ios - Android 类似 iOS 中的权限

javascript - Sails.js - Node.js - [ReferenceError : Promise is not defined]

node.js - NestJS - 文件上传到微服务

javascript - TypeError : util. promisify 不是函数?

node.js - 当我未登录 google 云端硬盘时,使用 google 云端硬盘 api 打开 google 云端硬盘文件

mysql - 风 sails : How to define association table mysql many-many