@opengis/fastify-table 2.0.159 → 2.0.160

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.
@@ -1 +1 @@
1
- {"version":3,"file":"access.user.d.ts","sourceRoot":"","sources":["../../../../../server/routes/access/controllers/access.user.ts"],"names":[],"mappings":"AAEA,wBAA8B,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,gBA6B5D"}
1
+ {"version":3,"file":"access.user.d.ts","sourceRoot":"","sources":["../../../../../server/routes/access/controllers/access.user.ts"],"names":[],"mappings":"AAEA,wBAA8B,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,gBAqC5D"}
@@ -11,11 +11,15 @@ export default async function accessUser(req, reply) {
11
11
  left join admin.role_access b on a.route_id=b.route_id
12
12
  where b.user_uid=$1`, [req.params.id])
13
13
  .then((el) => el.rows || []);
14
+ const resources = await pg
15
+ .query(`select resource_id, actions from admin.role_access
16
+ where resource_id is not null and user_uid=$1`, [req.params.id])
17
+ .then((el) => el.rows || []);
14
18
  const user = await pg
15
19
  .query(`select user_uid as id, user_name as name, access_granted,
16
20
  b.cdate as user_created, b.last_activity_date as last_activity from admin.user_roles a
17
21
  left join admin.users b on a.user_uid=b.uid
18
22
  where a.user_uid=$1`, [req.params.id])
19
23
  .then((el) => el.rows?.[0]);
20
- return reply.status(200).send({ routes, user });
24
+ return reply.status(200).send({ routes, resources, user });
21
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.159",
3
+ "version": "2.0.160",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [