f5a8c5a45d
Signed-off-by: Michael Mayer <michael@photoprism.app>
20 lines
509 B
Go
20 lines
509 B
Go
package acl
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestACL_Grants(t *testing.T) {
|
|
t.Run("RoleAdmin", func(t *testing.T) {
|
|
result := Resources.Grants(RoleAdmin)
|
|
assert.True(t, result[ResourcePhotos][ActionManage])
|
|
assert.True(t, result[ResourceConfig][ActionManage])
|
|
})
|
|
t.Run("RoleVisitor", func(t *testing.T) {
|
|
result := Resources.Grants(RoleVisitor)
|
|
assert.False(t, result[ResourcePhotos][ActionUpdate])
|
|
assert.False(t, result[ResourceConfig][ActionManage])
|
|
})
|
|
}
|