feat: permission system with withRules() wrapper #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add a developer-friendly permission system via a
withRules()wrapper indefaults/withRules.ts.How it works
Access is granted if any of the provided rules passes (OR logic). Two types of rules are supported:
DB-based permissions — checks the user's role against the
role_permissionstable:student_read,student_write,note_read,note_write,module_read,module_write,user_read,user_write,role_writeContextual rules — checks ownership based on the CAS uid (format:
{prenom[0]}{numEtud}):own_student,own_noteA CAS user that is neither in the
userstable nor thestudentstable has no rights.Usage
Branch
feature/permission-system