@dnax/core 0.74.3 → 0.74.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.
- package/app/hono.ts +4 -2
- package/index.ts +2 -0
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -243,6 +243,7 @@ function HonoInstance(): typeof app {
|
|
|
243
243
|
if (col && action && colAccess) {
|
|
244
244
|
let basicNextAccess = false;
|
|
245
245
|
|
|
246
|
+
// get permission by role
|
|
246
247
|
if (getPermission(session.get()?.role, tenant_id)) {
|
|
247
248
|
basicNextAccess = checkPermission(
|
|
248
249
|
session.get()?.role,
|
|
@@ -258,7 +259,8 @@ function HonoInstance(): typeof app {
|
|
|
258
259
|
|
|
259
260
|
nextLifecyle = basicNextAccess;
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
// si pas de role alors checking les permissions par access
|
|
263
|
+
if (col?.access?.hasOwnProperty(action) && !basicNextAccess) {
|
|
262
264
|
nextLifecyle = await col?.access[action]({
|
|
263
265
|
session: sessionStorage(),
|
|
264
266
|
action: action,
|
|
@@ -901,7 +903,7 @@ function HonoInstance(): typeof app {
|
|
|
901
903
|
}
|
|
902
904
|
|
|
903
905
|
app.onError((err, c) => {
|
|
904
|
-
console.error(err?.message);
|
|
906
|
+
// console.error(err?.message);
|
|
905
907
|
c.status(500);
|
|
906
908
|
return c.json({ message: err?.message });
|
|
907
909
|
});
|
package/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as v from "joi";
|
|
|
6
6
|
import { $ } from "bun";
|
|
7
7
|
import define from "./define";
|
|
8
8
|
import * as utils from "./utils";
|
|
9
|
+
import { app } from "./app/hono";
|
|
9
10
|
import { FilesystemSftpAdapter, MinioAdapter } from "./lib/media";
|
|
10
11
|
import { crypt } from "./lib/crypto";
|
|
11
12
|
import { contextStorage } from "./lib/asyncLocalStorage";
|
|
@@ -21,6 +22,7 @@ const Adapter = {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export {
|
|
25
|
+
app,
|
|
24
26
|
runApp,
|
|
25
27
|
define,
|
|
26
28
|
utils,
|