Skip to content

Commit e862fd7

Browse files
committed
Add some edges
1 parent 628f466 commit e862fd7

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
return strings.Join(allStrings, "\n")
148148
}
149149

150-
func WorkspaceWithDeps(id string, team *ObjTeam, template *ObjTemplate) *ObjWorkspace {
150+
func WorkspaceWithDeps(id string, 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 + provisioner relations
165+
// Add the template + provisioner relationship
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)