Skip to content

Commit

Permalink
scopes: allow read permission on 'user.metadata.internal'
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jan 7, 2025
1 parent 67ba7d2 commit f54583a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scopes/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ var (

// Grants access to all scopes - use sparingly.
"user.metadata",
// Read-only SAMS-internal metadata
"user.metadata.internal",
// Cody Pro and SSC metadata
"user.metadata.cody",
// Legacy Sourcegraph.com metadata
Expand Down Expand Up @@ -155,6 +157,11 @@ func Allowed() AllowedScopes {
// Add full { read, write, delete } actions for all permissions for the given service.
appendScopes := func(service services.Service, permissions []Permission) {
for _, permission := range permissions {
// Special case: read-only for SAMS-internal user metadata.
if permission == "user.metadata.internal" {
allowed = append(allowed, ToScope(service, permission, ActionRead))
continue
}
allowed = append(
allowed,
[]Scope{
Expand Down

0 comments on commit f54583a

Please sign in to comment.