Skip to content

feat: multiuser support with users and roles#19

Merged
biersoeckli merged 17 commits intomainfrom
feature/multiuser-support
Mar 24, 2025
Merged

feat: multiuser support with users and roles#19
biersoeckli merged 17 commits intomainfrom
feature/multiuser-support

Conversation

@biersoeckli
Copy link
Owner

@biersoeckli biersoeckli commented Mar 8, 2025

image

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:

  • Created Role and RoleAppPermission tables to manage user roles and permissions (prisma/migrations/20250226165121_migration/migration.sql, prisma/migrations/20250307150516_migration/migration.sql). [1] [2]
  • Updated the User table to include a foreign key reference to the Role table (prisma/migrations/20250226165121_migration/migration.sql).

Prisma Schema Updates:

  • Added new models Role and RoleAppPermission and updated the User and App models to include role references (prisma/schema.prisma). [1] [2] [3]

Utility Functions:

  • Added RoleUtils with methods for checking admin status, role permissions, and session capabilities (src/__tests__/shared/utils/role.utils.test.ts).

Authorization Checks:

  • Added isAuthorizedReadForApp and isAuthorizedForBackups checks in various server actions and routes to ensure proper access control

Error Handling:

  • Implemented a global error boundary component to handle unexpected errors and display user-friendly messages (src/app/global-error.tsx).

@biersoeckli biersoeckli self-assigned this Mar 8, 2025
@biersoeckli biersoeckli changed the title feat: multiuser support 9-multiuser-support Mar 8, 2025
@biersoeckli biersoeckli changed the title 9-multiuser-support feat: multiuser support Mar 8, 2025
@biersoeckli biersoeckli changed the title feat: multiuser support feat: multiuser support with users and roles Mar 8, 2025
Repository owner deleted a comment from vercel bot Mar 8, 2025
@vercel
Copy link

vercel bot commented Mar 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
get-quickstack ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 9:28am

…and if necessary only to specific apps, rewrite the role edit dialog and role utils
@biersoeckli biersoeckli merged commit bdc134e into main Mar 24, 2025
5 checks passed
@biersoeckli biersoeckli deleted the feature/multiuser-support branch December 4, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant