@heliyos/heliyos-api-core 1.0.32 → 1.0.34

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.
@@ -233,12 +233,13 @@ const setLoggedInUser = function (container, req) {
233
233
  //
234
234
  // Handle Cookie and Bearer token
235
235
  const { output: { loggedInUser }, } = container;
236
- const { token, userId, organizationId } = loggedInUser;
236
+ const { token, userId, organizationId, role } = loggedInUser;
237
237
  // Modify req object with logged in user data
238
238
  req.loggedInUser = {
239
239
  token,
240
240
  userId,
241
241
  organizationId,
242
+ role,
242
243
  auth_type,
243
244
  };
244
245
  return undefined;
@@ -262,6 +263,7 @@ const callAuthApiServer = (token) => __awaiter(void 0, void 0, void 0, function*
262
263
  token,
263
264
  userId: authResult.data.data.payload.userId,
264
265
  organizationId: authResult.data.data.payload.organizationId,
266
+ role: authResult.data.data.payload.role,
265
267
  };
266
268
  }
267
269
  else {
@@ -75,5 +75,17 @@ export type ResourcePolicyActionsType = {
75
75
  UPDATE_ENTITY_LIST_RECORD: string;
76
76
  DELETE_ENTITY_LIST_RECORD: string;
77
77
  };
78
+ SCHEMA: {
79
+ VIEW_SCHEMA: string;
80
+ CREATE_SCHEMA: string;
81
+ UPDATE_SCHEMA: string;
82
+ DELETE_SCHEMA: string;
83
+ };
84
+ OBJECT: {
85
+ VIEW_OBJECT: string;
86
+ CREATE_OBJECT: string;
87
+ UPDATE_OBJECT: string;
88
+ DELETE_OBJECT: string;
89
+ };
78
90
  };
79
91
  export {};
@@ -70,6 +70,18 @@ exports.authPolicy = {
70
70
  UPDATE_ENTITY_LIST_RECORD: "UPDATE_ENTITY_LIST_RECORD",
71
71
  DELETE_ENTITY_LIST_RECORD: "DELETE_ENTITY_LIST_RECORD",
72
72
  },
73
+ SCHEMA: {
74
+ VIEW_SCHEMA: "VIEW_SCHEMA",
75
+ CREATE_SCHEMA: "CREATE_SCHEMA",
76
+ UPDATE_SCHEMA: "UPDATE_SCHEMA",
77
+ DELETE_SCHEMA: "DELETE_SCHEMA",
78
+ },
79
+ OBJECT: {
80
+ VIEW_OBJECT: "VIEW_OBJECT",
81
+ CREATE_OBJECT: "CREATE_OBJECT",
82
+ UPDATE_OBJECT: "UPDATE_OBJECT",
83
+ DELETE_OBJECT: "DELETE_OBJECT",
84
+ },
73
85
  },
74
86
  ROLES_PERMISSIONS: {
75
87
  TEAM_MEMBER: [
@@ -69,6 +69,18 @@ export const authPolicy: IAuthPolicy = {
69
69
  UPDATE_ENTITY_LIST_RECORD: "UPDATE_ENTITY_LIST_RECORD",
70
70
  DELETE_ENTITY_LIST_RECORD: "DELETE_ENTITY_LIST_RECORD",
71
71
  },
72
+ SCHEMA: {
73
+ VIEW_SCHEMA: "VIEW_SCHEMA",
74
+ CREATE_SCHEMA: "CREATE_SCHEMA",
75
+ UPDATE_SCHEMA: "UPDATE_SCHEMA",
76
+ DELETE_SCHEMA: "DELETE_SCHEMA",
77
+ },
78
+ OBJECT: {
79
+ VIEW_OBJECT: "VIEW_OBJECT",
80
+ CREATE_OBJECT: "CREATE_OBJECT",
81
+ UPDATE_OBJECT: "UPDATE_OBJECT",
82
+ DELETE_OBJECT: "DELETE_OBJECT",
83
+ },
72
84
  },
73
85
  ROLES_PERMISSIONS: {
74
86
  TEAM_MEMBER: [
@@ -464,4 +476,16 @@ export type ResourcePolicyActionsType = {
464
476
  UPDATE_ENTITY_LIST_RECORD: string;
465
477
  DELETE_ENTITY_LIST_RECORD: string;
466
478
  };
479
+ SCHEMA: {
480
+ VIEW_SCHEMA: string;
481
+ CREATE_SCHEMA: string;
482
+ UPDATE_SCHEMA: string;
483
+ DELETE_SCHEMA: string;
484
+ };
485
+ OBJECT: {
486
+ VIEW_OBJECT: string;
487
+ CREATE_OBJECT: string;
488
+ UPDATE_OBJECT: string;
489
+ DELETE_OBJECT: string;
490
+ };
467
491
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heliyos/heliyos-api-core",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Heliyos's core api functions and middlewares. Its a private package hosted on npm.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {