chore(rbac): user link and utils (#14320)

This commit is contained in:
Carlos R. L. Rodrigues
2026-01-07 10:40:15 -03:00
committed by GitHub
parent 7161cf1903
commit b2245cc672
72 changed files with 2746 additions and 703 deletions

View File

@@ -7,11 +7,12 @@ export * from "./jobs"
export * from "./links"
export * from "./logger"
export * from "./medusa-app-loader"
export * from "./subscribers"
export * from "./workflows"
export * from "./telemetry"
export * from "./zod"
export * from "./migrations"
export * from "./policies"
export * from "./subscribers"
export * from "./telemetry"
export * from "./workflows"
export * from "./zod"
export const MEDUSA_CLI_PATH = require.resolve("@medusajs/cli")

View File

@@ -0,0 +1 @@
export * from "./policy-loader"

View File

@@ -0,0 +1,16 @@
import { discoverPoliciesFromDir } from "@medusajs/utils"
import { normalize } from "path"
/**
* Load RBAC policies from a directory
* @param sourcePath - Path to scan for policies directories
*/
export async function policiesLoader(sourcePath?: string): Promise<void> {
if (!sourcePath) {
return
}
const policyDir = normalize(sourcePath)
await discoverPoliciesFromDir(policyDir)
}