Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scopes/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ var (
analyticsPermissions = []Permission{
"analytics",
}
cloudAPIPermissions = []Permission{
"instance",
}
)

const (
Expand Down Expand Up @@ -199,6 +202,7 @@ func Allowed() AllowedScopes {
appendScopes(services.MailGatekeeper, mailGatekeeperPermissions)
appendScopes(services.Workspaces, workspacesPermissions)
appendScopes(services.Analytics, analyticsPermissions)
appendScopes(services.CloudAPI, cloudAPIPermissions)
// 👉 ADD YOUR SCOPES HERE
return allowed
}
Expand Down
3 changes: 3 additions & 0 deletions scopes/scopes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func TestAllowedGoldenList(t *testing.T) {
Scope("analytics::analytics::read"),
Scope("analytics::analytics::write"),
Scope("analytics::analytics::delete"),
Scope("cloud_api::instance::read"),
Scope("cloud_api::instance::write"),
Scope("cloud_api::instance::delete"),
}).Equal(t, Allowed())
}

Expand Down
2 changes: 2 additions & 0 deletions services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
Workspaces Service = "workspaces"
SSC Service = "ssc"
Analytics Service = "analytics"
CloudAPI Service = "cloud_api"
)

var serviceNames = map[Service]string{
Expand All @@ -28,6 +29,7 @@ var serviceNames = map[Service]string{
Workspaces: "Workspaces",
SSC: "Self Serve Cody",
Analytics: "Sourcegraph Analytics",
CloudAPI: "Cloud API",
}

func (s Service) DisplayName() string {
Expand Down
Loading