@nocobase/plugin-data-visualization 2.0.0-alpha.45 → 2.0.0-alpha.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,18 +8,18 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.0.0-alpha.45",
11
+ "@nocobase/client": "2.0.0-alpha.47",
12
12
  "@formily/react": "2.3.7",
13
- "@nocobase/plugin-ai": "2.0.0-alpha.45",
14
- "@nocobase/flow-engine": "2.0.0-alpha.45",
13
+ "@nocobase/plugin-ai": "2.0.0-alpha.47",
14
+ "@nocobase/flow-engine": "2.0.0-alpha.47",
15
15
  "react-i18next": "11.18.6",
16
16
  "dayjs": "1.11.13",
17
17
  "@formily/shared": "2.3.7",
18
18
  "lodash": "4.17.21",
19
- "@nocobase/cache": "2.0.0-alpha.45",
20
- "@nocobase/server": "2.0.0-alpha.45",
21
- "@nocobase/test": "2.0.0-alpha.45",
22
- "@nocobase/utils": "2.0.0-alpha.45",
19
+ "@nocobase/cache": "2.0.0-alpha.47",
20
+ "@nocobase/server": "2.0.0-alpha.47",
21
+ "@nocobase/test": "2.0.0-alpha.47",
22
+ "@nocobase/utils": "2.0.0-alpha.47",
23
23
  "react": "18.2.0",
24
24
  "@emotion/css": "11.13.0",
25
25
  "@ant-design/icons": "5.6.1",
@@ -27,8 +27,9 @@ module.exports = {
27
27
  "antd": "5.24.2",
28
28
  "@formily/antd-v5": "1.2.3",
29
29
  "@formily/core": "2.3.7",
30
- "@nocobase/actions": "2.0.0-alpha.45",
31
- "@nocobase/database": "2.0.0-alpha.45",
30
+ "@nocobase/actions": "2.0.0-alpha.47",
31
+ "@nocobase/database": "2.0.0-alpha.47",
32
+ "@nocobase/acl": "2.0.0-alpha.47",
32
33
  "sequelize": "6.35.2",
33
34
  "@formily/reactive": "2.3.7"
34
35
  };
@@ -1 +1 @@
1
- {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2025-11-21T08:02:50.448Z"}
1
+ {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2025-11-26T03:34:23.694Z"}
@@ -1 +1 @@
1
- {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-11-21T08:02:51.045Z"}
1
+ {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-11-26T03:34:24.276Z"}
@@ -49,6 +49,8 @@ var import_database = require("@nocobase/database");
49
49
  var import_koa_compose = __toESM(require("koa-compose"));
50
50
  var import_server = require("@nocobase/server");
51
51
  var import_query_parser = require("../query-parser");
52
+ var import_utils = require("@nocobase/utils");
53
+ var import_acl = require("@nocobase/acl");
52
54
  const getDB = (ctx, dataSource) => {
53
55
  const ds = ctx.app.dataSourceManager.dataSources.get(dataSource);
54
56
  return ds == null ? void 0 : ds.collectionManager.db;
@@ -217,8 +219,8 @@ const cacheMiddleware = async (ctx, next) => {
217
219
  await cache.set(uid, ctx.body, (cacheConfig == null ? void 0 : cacheConfig.ttl) * 1e3);
218
220
  }
219
221
  };
220
- const checkPermission = (ctx, next) => {
221
- var _a;
222
+ const checkPermission = async (ctx, next) => {
223
+ var _a, _b;
222
224
  const { collection, dataSource } = ctx.action.params.values;
223
225
  const roleNames = ctx.state.currentRoles || ["anonymous"];
224
226
  const acl = ((_a = ctx.app.dataSourceManager.get(dataSource)) == null ? void 0 : _a.acl) || ctx.app.acl;
@@ -226,6 +228,22 @@ const checkPermission = (ctx, next) => {
226
228
  if (!can && !roleNames.includes("root")) {
227
229
  ctx.throw(403, "No permissions");
228
230
  }
231
+ if ((_b = can == null ? void 0 : can.params) == null ? void 0 : _b.filter) {
232
+ try {
233
+ acl.filterParams(ctx, collection, can.params);
234
+ } catch (e) {
235
+ if (e instanceof import_acl.NoPermissionError) {
236
+ ctx.throw(403, "No permissions");
237
+ }
238
+ }
239
+ const filter = ctx.action.params.values.filter || {};
240
+ ctx.action.params.values = {
241
+ ...ctx.action.params.values,
242
+ filter: (0, import_utils.assign)(filter, can == null ? void 0 : can.params.filter, {
243
+ filter: "andMerge"
244
+ })
245
+ };
246
+ }
229
247
  return next();
230
248
  };
231
249
  const query = async (ctx, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "2.0.0-alpha.45",
3
+ "version": "2.0.0-alpha.47",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.ru-RU": "Визуализация данных",
6
6
  "displayName.zh-CN": "数据可视化",
@@ -45,7 +45,7 @@
45
45
  "@nocobase/test": "2.x",
46
46
  "@nocobase/utils": "2.x"
47
47
  },
48
- "gitHead": "ddb6d6b89f4f3dc49dc942d46901e9e6f159be58",
48
+ "gitHead": "50e5bfd0c5b6879535d20abcbbabc5541d749e12",
49
49
  "keywords": [
50
50
  "Blocks"
51
51
  ]