convertStringToPermissionScope converts a string key to a PermissionScope
(key string)
| 29 | |
| 30 | // convertStringToPermissionScope converts a string key to a PermissionScope |
| 31 | func 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) |
| 46 | type PermissionLevel string |