MCPcopy Create free account
hub / github.com/github/gh-aw / convertStringToPermissionScope

Function convertStringToPermissionScope

pkg/workflow/permissions.go:31–43  ·  view source on GitHub ↗

convertStringToPermissionScope converts a string key to a PermissionScope

(key string)

Source from the content-addressed store, hash-verified

29
30// convertStringToPermissionScope converts a string key to a PermissionScope
31func convertStringToPermissionScope(key string) PermissionScope {
32 if key == "all" {
33 // "all" is a meta-key handled at the parser level; it is not a real scope
34 return ""
35 }
36
37 if _, exists := validPermissionScopes[key]; !exists {
38 permissionsLog.Printf("Unknown permission scope key: %s", key)
39 return ""
40 }
41
42 return PermissionScope(key)
43}
44
45// PermissionLevel represents the level of access (read, write, none)
46type PermissionLevel string

Calls 2

PermissionScopeTypeAlias · 0.85
PrintfMethod · 0.45