mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
2f88c2216c
- 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.
8 lines
398 B
TypeScript
8 lines
398 B
TypeScript
import { Permission } from "auth/authorize/Permission";
|
|
|
|
export const createUser = new Permission("auth.user.create");
|
|
//export const updateUser = new Permission("auth.user.update");
|
|
export const testPassword = new Permission("auth.user.password.test");
|
|
export const changePassword = new Permission("auth.user.password.change");
|
|
export const createToken = new Permission("auth.user.token.create");
|