photoprism/internal/acl/grant_test.go

20 lines
412 B
Go
Raw Normal View History

2023-12-15 13:16:32 +01:00
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"))
})
}