photoprism/internal/acl/perms_test.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

22 lines
532 B
Go

package acl
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPermissions_String(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
perms := Permissions{}
assert.Equal(t, "", perms.String())
})
t.Run("FullAccess", func(t *testing.T) {
perms := Permissions{FullAccess}
assert.Equal(t, "full access", perms.String())
})
t.Run("ManageUploadAll", func(t *testing.T) {
perms := Permissions{ActionManage, ActionUpload, AccessAll}
assert.Equal(t, "manage, upload, access all", perms.String())
})
}