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

Commite862fd7

Browse files
committed
Add some edges
1 parent628f466 commite862fd7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

‎coderd/database/spice/policy/playground/relationships/manualobjects.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ func AllRelationsToStrings() string {
147147
returnstrings.Join(allStrings,"\n")
148148
}
149149

150-
funcWorkspaceWithDeps(idstring,team*ObjTeam,template*ObjTemplate)*ObjWorkspace {
150+
funcWorkspaceWithDeps(idstring,team*ObjTeam,template*ObjTemplate,)*ObjWorkspace {
151151
// Building a workspace means the team needs access to the template + provisioner
152-
template.CanUseBy(team)// This should be a perm check
152+
template.CanUseBy(team)// Team perm check.
153+
153154

154155
workspace:=Workspace(id).Owner(team)
155156
build:=Workspace_build(fmt.Sprintf("%s/build",id)).
@@ -161,7 +162,7 @@ func WorkspaceWithDeps(id string, team *ObjTeam, template *ObjTemplate) *ObjWork
161162
resources:=Workspace_resources(fmt.Sprintf("%s/resources",id)).
162163
Workspace(workspace)
163164

164-
// Add the template + provisionerrelations
165+
// Add the template + provisionerrelationship
165166
template.Workspace(workspace)
166167

167168
var_,_,_,_=build,agent,app,resources

‎coderd/database/spice/policy/playground/relationships/relationships.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ func GenerateRelationships() {
7676
Workspace_creatorUser(elliot)
7777

7878
// Make some resources!
79-
devTemplate:=Template("dev-template").Owner(teamDevelopers)
79+
devTemplate:=Template("dev-template").Owner(teamEngineering)
8080
devVersion:=devTemplate.Version("active")
8181
devTemplate.CannotUseBy(teamMarketing)
8282
var_=devVersion
8383

84+
// Steven will create a workspace.
85+
teamDevelopers.CanCreate_workspaceBy(steven)// Perm check
8486
stevenWorkspace:=WorkspaceWithDeps("steven-workspace",teamDevelopers,devTemplate).
8587
ViewerUser(steven).
8688
EditorUser(steven).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp