From 06dc749257acebdf26fd0368cde031943a167c5a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 6 Apr 2022 15:11:41 -0400 Subject: [PATCH] fix: allow admin for anon-access --- internal/config/defaults.go | 4 ++-- internal/config/git.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 60a93b36dfb3cccd4b8dad0c4502476ae83b5e3c..052e6a1f6418585666b58f25a565b21d974da322 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -11,8 +11,8 @@ name: Soft Serve host: %s port: %d -# Access level for anonymous users. Options are: read-write, read-only and -# no-access. +# Access level for anonymous users. Options are: admin-access, read-write, +# read-only, and no-access. anon-access: %s # You can grant read-only access to users without private keys. Any password diff --git a/internal/config/git.go b/internal/config/git.go index 0d96f95db0e056d69d6097e3033a369cf501f66f..54eb0df6bd291aebe75e16cb63fd86241d008187 100644 --- a/internal/config/git.go +++ b/internal/config/git.go @@ -87,6 +87,8 @@ func (cfg *Config) accessForKey(repo string, pk ssh.PublicKey) gm.AccessLevel { return gm.ReadOnlyAccess case "read-write": return gm.ReadWriteAccess + case "admin-access": + return gm.AdminAccess default: return gm.NoAccess }