vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Name role capabilities consistently
cc5123a549d8d0991e74a88fff8208b5071d1192 · Keenan Nemetz · 1d ago · parent 648cd81b
forge/access/acl_test.go +6−4
| @@ -19,6 +19,7 @@ func TestRoleOrdering(t *testing.T) { | |||
| 19 | 19 | }{ | |
| 20 | 20 | {"none", None, true}, | |
| 21 | 21 | {"", None, true}, | |
| 22 | {"reader", Read, true}, | ||
| 22 | 23 | {"read", Read, true}, | |
| 23 | 24 | {"contributor", Contribute, true}, | |
| 24 | 25 | {"contribute", Contribute, true}, | |
| @@ -28,6 +29,7 @@ func TestRoleOrdering(t *testing.T) { | |||
| 28 | 29 | {"maintainer", Maintain, true}, | |
| 29 | 30 | {"write", Maintain, true}, | |
| 30 | 31 | {"admin", Admin, true}, | |
| 32 | {"administrator", Admin, true}, | ||
| 31 | 33 | {"owner", Admin, true}, | |
| 32 | 34 | {"ADMIN", Admin, true}, | |
| 33 | 35 | {"root", None, false}, | |
| @@ -43,28 +45,28 @@ func TestRoleOrdering(t *testing.T) { | |||
| 43 | 45 | } | |
| 44 | 46 | func TestWriteIsTheHistoricalSpellingOfMaintain(t *testing.T) { | |
| 45 | 47 | t.Parallel() | |
| 46 | if got, err := ParseRole("write"); err != nil || got != Maintain || got.String() != "maintain" { | ||
| 48 | if got, err := ParseRole("write"); err != nil || got != Maintain || got.String() != "maintainer" { | ||
| 47 | 49 | t.Fatalf("ParseRole(write) = %v, %v", got, err) | |
| 48 | 50 | } | |
| 49 | 51 | a, err := Parse([]byte(`{"version":1,"default":"write","entries":{"alice":"write"}}`)) | |
| 50 | 52 | if err != nil { | |
| 51 | 53 | t.Fatal(err) | |
| 52 | 54 | } | |
| 53 | if a.Default != "maintain" || a.Entries["alice"] != "maintain" { | ||
| 55 | if a.Default != "maintainer" || a.Entries["alice"] != "maintainer" { | ||
| 54 | 56 | t.Fatalf("old spelling was not normalized: %+v", a) | |
| 55 | 57 | } | |
| 56 | 58 | } | |
| 57 | 59 | ||
| 58 | 60 | func TestContributorIsTheHistoricalSpellingOfContribute(t *testing.T) { | |
| 59 | 61 | t.Parallel() | |
| 60 | if Contributor != Contribute || Contribute.String() != "contribute" { | ||
| 62 | if Contributor != Contribute || Contribute.String() != "contributor" { | ||
| 61 | 63 | t.Fatalf("Contribute = %v, alias = %v", Contribute, Contributor) | |
| 62 | 64 | } | |
| 63 | 65 | a, err := Parse([]byte(`{"version":1,"default":"contributor","entries":{"alice":"contributor"}}`)) | |
| 64 | 66 | if err != nil { | |
| 65 | 67 | t.Fatal(err) | |
| 66 | 68 | } | |
| 67 | if a.Default != "contribute" || a.Entries["alice"] != "contribute" { | ||
| 69 | if a.Default != "contributor" || a.Entries["alice"] != "contributor" { | ||
| 68 | 70 | t.Fatalf("old spelling was not normalized: %+v", a) | |
| 69 | 71 | } | |
| 70 | 72 | } | |