feat: multiuser support with users and roles#19
Merged
biersoeckli merged 17 commits intomainfrom Mar 24, 2025
Merged
Conversation
…r role management
…hentication utils
…s table with app data
… session and implementing role utility functions
… role permissions validation for server actions
…date related models and utilities
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…and if necessary only to specific apps, rewrite the role edit dialog and role utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to Issue #9
This pull request includes the creation of new tables for roles and permissions, schema updates to include roles, new utility functions for role-based access control, and the addition of authorization checks in various routes.
Database Schema Changes:
RoleandRoleAppPermissiontables to manage user roles and permissions (prisma/migrations/20250226165121_migration/migration.sql,prisma/migrations/20250307150516_migration/migration.sql). [1] [2]Usertable to include a foreign key reference to theRoletable (prisma/migrations/20250226165121_migration/migration.sql).Prisma Schema Updates:
RoleandRoleAppPermissionand updated theUserandAppmodels to include role references (prisma/schema.prisma). [1] [2] [3]Utility Functions:
RoleUtilswith methods for checking admin status, role permissions, and session capabilities (src/__tests__/shared/utils/role.utils.test.ts).Authorization Checks:
isAuthorizedReadForAppandisAuthorizedForBackupschecks in various server actions and routes to ensure proper access controlError Handling:
src/app/global-error.tsx).