[v5.x] feat: scaffold workspaces#9247
Draft
peaklabs-dev wants to merge 16 commits intov5.x-feat/scaffold-authfrom
Draft
[v5.x] feat: scaffold workspaces#9247peaklabs-dev wants to merge 16 commits intov5.x-feat/scaffold-authfrom
peaklabs-dev wants to merge 16 commits intov5.x-feat/scaffold-authfrom
Conversation
cfad38a to
d355a18
Compare
d8d7049 to
c4f38ac
Compare
89798ab to
7b5b139
Compare
7b5b139 to
5ce4836
Compare
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.
Scaffold the full workspaces system (replacing v4 teams) including a workspace global scope and middleware that reduce ~2,800 lines of manual team checks across ~400 files down to ~114 lines across 2 files (and models).
Changes
InvitationMethodenumPermissionenumUserRoleenumWorkspaceScopethat automatically appliesWHERE workspace_id = ULIDto every scoped model querySetWorkspacemiddleware which resolves workspaces via URL parameter > cookie > session > auto-select (single workspace) and validates membership#[ScopedBy]v4 Comparison
UserRoleenum defining all predefined roles in one place, replacing scattered role-check methods (isAdmin(),isMember(), etc.) with a single enum-based approach supporting granular permissions and adding new permissions to existing roles without a database migrationPermissionenum with granular permissions per feature (e.g.WorkspaceRead,WorkspaceCreate,WorkspaceUpdate,WorkspaceDestroy), defined as string-backed enums so changes are code-only, not database migrationsWorkspace scope
ownedByCurrentTeam(),currentTeam()->id,teams->contains(),whereTeamId()…#[ScopedBy]context()TODO
This is part 2 of 3 in a stack made with GitButler: