Skip to content

PR: changes for migration#528

Merged
icecrasher321 merged 1 commit into
mainfrom
feature/migration-access-control-permissions
Jun 21, 2025
Merged

PR: changes for migration#528
icecrasher321 merged 1 commit into
mainfrom
feature/migration-access-control-permissions

Conversation

@SHARKYBOY1248
Copy link
Copy Markdown
Contributor

Same PR as feature/access-control-permissions but just the db migration changes so we can do those first

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 21, 2025

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

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 9:55pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jun 21, 2025 9:55pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Major database schema update implementing a comprehensive permissions system with role-based access control and entity-level permissions.

  • Added new permission_type enum and permissions table in apps/sim/db/migrations/0046_loose_blizzard.sql with admin/write/read access levels
  • Implemented unique constraint and btree indexes in permissions table for efficient access control lookups
  • Added permissions column to workspace_invitation table for granular invitation control
  • Created foreign key relationships between permissions and user tables with proper cascade behaviors
  • Set up optimized query patterns with composite indexes on (entity_type, entity_id, user_id)

4 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment thread apps/sim/db/schema.ts
userId: text('user_id')
.notNull()
.references(() => user.id, { onDelete: 'cascade' }),
entityType: text('entity_type').notNull(), // 'workspace', 'workflow', 'organization', etc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider adding a check constraint to validate entityType values to prevent invalid types

@icecrasher321 icecrasher321 merged commit 609ce5c into main Jun 21, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the feature/migration-access-control-permissions branch June 28, 2025 04:47
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.

2 participants