Introduce global scope (#168)
Introduce the global scope, which holds some resources that don't necessarily belong at either the org or project level.
This commit is contained in:
1 parent
6c1b45f7f5
commit
732c07126d
15 files changed
+353
-79
No files matched your search
@@ -5,13 +5,15 @@ type Type uint32
|
||||
|
||||
const (
|
||||
Unknown Type = 0
|
||||
Organization Type = 1
|
||||
Project Type = 2
|
||||
Global Type = 1
|
||||
Organization Type = 2
|
||||
Project Type = 3
|
||||
)
|
||||
|
||||
func (s Type) String() string {
|
||||
return [...]string{
|
||||
"unknown",
|
||||
"global",
|
||||
"organization",
|
||||
"project",
|
||||
}[s]
|
||||
@@ -20,6 +22,7 @@ func (s Type) String() string {
|
||||
func (s Type) Prefix() string {
|
||||
return [...]string{
|
||||
"unknown",
|
||||
"global",
|
||||
"o",
|
||||
"p",
|
||||
}[s]
|
||||
@@ -27,6 +30,8 @@ func (s Type) Prefix() string {
|
||||
|
||||
func StringToScopeType(s string) Type {
|
||||
switch s {
|
||||
case Global.String():
|
||||
return Global
|
||||
case Organization.String():
|
||||
return Organization
|
||||
case Project.String():
|
||||
|
||||
@@ -13,6 +13,12 @@ func Test_StringToScopeType(t *testing.T) {
|
||||
want Type
|
||||
wantPrefix string
|
||||
}{
|
||||
{
|
||||
name: "global",
|
||||
s: "global",
|
||||
want: Global,
|
||||
wantPrefix: "global",
|
||||
},
|
||||
{
|
||||
name: "org",
|
||||
s: "organization",
|
||||
|
||||
Reference in new issue
Block a user