mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
refactor: restructure permission handling and enhance Guard functionality
- Introduced a new `createGuard` function to streamline the creation of Guard instances with permissions and roles. - Updated tests in `authorize.spec.ts` to reflect changes in permission checks, ensuring they now return undefined for denied permissions. - Added new `Permission` and `Policy` classes to improve type safety and flexibility in permission management. - Refactored middleware and controller files to utilize the updated permission structure, including context handling for permissions. - Created a new `SystemController.spec.ts` file to test the integration of the new permission system within the SystemController. - Removed legacy permission handling from core security files, consolidating permission logic within the new structure.
This commit is contained in:
@@ -45,7 +45,7 @@ export type { MaybePromise } from "core/types";
|
||||
export { Exception, BkndError } from "core/errors";
|
||||
export { isDebug, env } from "core/env";
|
||||
export { type PrimaryFieldType, config, type DB, type AppEntity } from "core/config";
|
||||
export { Permission } from "core/security/Permission";
|
||||
export { Permission } from "auth/authorize/Permission";
|
||||
export { getFlashMessage } from "core/server/flash";
|
||||
export * from "core/drivers";
|
||||
export { Event, InvalidEventReturn } from "core/events/Event";
|
||||
|
||||
Reference in New Issue
Block a user