-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
695 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package accesscontrol | ||
|
||
// PrivilegeScope enumerates valid scopes for privileges. | ||
type PrivilegeScope int | ||
|
||
const ( | ||
// Global scoped privileges. | ||
Global PrivilegeScope = iota | ||
|
||
// NamespaceSet is namespace and optional set scoped privilege. | ||
NamespaceSet | ||
) | ||
|
||
// Privileges are all privilege string allowed in the spec and associated scopes. | ||
var Privileges = map[string][]PrivilegeScope{ | ||
"read": {Global, NamespaceSet}, | ||
"write": {Global, NamespaceSet}, | ||
"read-write": {Global, NamespaceSet}, | ||
"read-write-udf": {Global, NamespaceSet}, | ||
"data-admin": {Global}, | ||
"sys-admin": {Global}, | ||
"user-admin": {Global}, | ||
"truncate": {Global, NamespaceSet}, | ||
"sindex-admin": {Global}, | ||
"udf-admin": {Global}, | ||
} | ||
|
||
// Post6Privileges are post version 6.0 privilege strings allowed in the spec and associated scopes. | ||
var Post6Privileges = map[string][]PrivilegeScope{ | ||
"truncate": {Global, NamespaceSet}, | ||
"sindex-admin": {Global}, | ||
"udf-admin": {Global}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters