photoprism/internal/acl/grant_test.go
2023-12-15 13:16:32 +01:00

19 lines
412 B
Go

package acl
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGrant_Allow(t *testing.T) {
t.Run("ViewAllDownload", func(t *testing.T) {
assert.True(t, GrantViewAll.Allow(ActionView))
})
t.Run("ViewAllShare", func(t *testing.T) {
assert.False(t, GrantViewAll.Allow(ActionShare))
})
t.Run("UnknownAction", func(t *testing.T) {
assert.False(t, GrantViewAll.Allow("lovecats"))
})
}