@dnax/core 0.3.3 → 0.3.4

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.
Files changed (2) hide show
  1. package/app/hono.ts +21 -12
  2. package/package.json +1 -1
package/app/hono.ts CHANGED
@@ -142,7 +142,8 @@ function HonoInstance(): typeof app {
142
142
  let colAccess =
143
143
  col?.access?.hasOwnProperty(action) ||
144
144
  session.get()?.access?.hasOwnProperty(action) ||
145
- null;
145
+ session.get()?.access?.hasOwnProperty("allAction");
146
+ null;
146
147
  let nextLifecyle: any = false;
147
148
 
148
149
  // Middleware for apis
@@ -192,17 +193,25 @@ function HonoInstance(): typeof app {
192
193
  });
193
194
  } else {
194
195
  if (col && action && colAccess) {
195
- let basicNextAccess = session?.get()?.access?.hasOwnProperty(action)
196
- ? session?.get()?.access?.[action]
197
- : false;
198
- nextLifecyle =
199
- (await col?.access[action]({
200
- session: sessionStorage(),
201
- action: action,
202
- c: c,
203
- isAuth: c.var?._v?.isAuth || false,
204
- rest: new useRest({ tenant_id: tenant_id }),
205
- })) || basicNextAccess;
196
+ let basicNextAccess = false;
197
+
198
+ if (session.get().access.hasOwnProperty(action)) {
199
+ basicNextAccess = session.get().access[action];
200
+ }
201
+
202
+ if (session.get().access.hasOwnProperty("allAction")) {
203
+ basicNextAccess = session.get().access["allAction"];
204
+ }
205
+
206
+ nextLifecyle = basicNextAccess
207
+ ? basicNextAccess
208
+ : await col?.access[action]({
209
+ session: sessionStorage(),
210
+ action: action,
211
+ c: c,
212
+ isAuth: c.var?._v?.isAuth || false,
213
+ rest: new useRest({ tenant_id: tenant_id }),
214
+ });
206
215
  }
207
216
  }
208
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {