Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: allow TemplateAdmin to delete prebuilds via auth layer (POC)#18333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ssncferreira wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromssncferreira/poc-prebuild-rbac-authz

Conversation

ssncferreira
Copy link
Contributor

@ssncferreirassncferreira commentedJun 11, 2025
edited
Loading

POC (Do not Merge)

Support TemplateAdmin to delete prebuild workspaces via the authorization layer

@ssncferreirassncferreira changed the titlefeat: POC for allowing TemplateAdmin to delete prebuild workspaces via auth layerfeat: poc to allow TemplateAdmin to delete prebuilds via auth layerJun 11, 2025
@ssncferreirassncferreiraforce-pushed thessncferreira/poc-prebuild-rbac-authz branch 2 times, most recently frome05480d todb80b4dCompareJune 11, 2025 19:37
@ssncferreirassncferreiraforce-pushed thessncferreira/poc-prebuild-rbac-authz branch fromdb80b4d to2ba15c5CompareJune 11, 2025 19:38
Comment on lines 235 to 247
func (w Workspace) IsPrebuild() bool {
// TODO: avoid import cycle
return w.OwnerID == uuid.MustParse("c42fdf75-3097-471c-8c33-fb52454d81c0")
}

func (w Workspace) PrebuildRBAC() rbac.Object {
if w.IsPrebuild() {
return rbac.ResourcePrebuiltWorkspace.WithID(w.ID).
InOrg(w.OrganizationID).
WithOwner(w.OwnerID.String())
}
return w.RBACObject()
}
Copy link
Member

Choose a reason for hiding this comment

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

🤔 what about

func (w Workspace) AsPrebuild (rbac.Object, bool) {}if pb, ok := obj.AsPrebuild(); ok {  ...}

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

🤔 In this case, I think having a separateIsPrebuild() andAsPrebuild() keeps things a bit clearer. Combining them might actually make the logic harder to follow in places likeauthorizeWorkspace() or the fallback auth checks. But let me know what you think!

@ssncferreirassncferreira changed the titlefeat: poc to allow TemplateAdmin to delete prebuilds via auth layerfeat: allow TemplateAdmin to delete prebuilds via auth layer in POCJun 12, 2025
@ssncferreirassncferreira changed the titlefeat: allow TemplateAdmin to delete prebuilds via auth layer in POCfeat: allow TemplateAdmin to delete prebuilds via auth layer (POC)Jun 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@johnstcnjohnstcnjohnstcn left review comments

At least 1 approving review is required to merge this pull request.

Assignees

@ssncferreirassncferreira

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ssncferreira@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp