Disable ownership on mobile

This commit is contained in:
Theodor S. Midtlien
2026-09-22 15:29:39 +02:00
parent a785814a3f
commit 9d40a09459
9 changed files with 70 additions and 10 deletions
@@ -7,8 +7,19 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/netbirdio/netbird/client/internal/ipcauth"
)
func TestAccessibleByReachesUnownedProfileWhenOwnershipDisabled(t *testing.T) {
t.Setenv(ipcauth.EnvDisableProfileOwnership, "true")
unowned := Profile{}
caller := ipcauth.KnownForTest(ipcauth.Identity{UID: 4242})
assert.True(t, unowned.AccessibleBy(caller), "an unowned profile is reachable with ownership off")
}
func withTempConfigDir(t *testing.T, testFunc func(configDir string)) {
t.Helper()
tempDir := t.TempDir()