mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
21 lines
501 B
Go
21 lines
501 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 := Rules.Grants(RoleAdmin)
|
|
assert.True(t, result[ResourcePhotos][ActionManage])
|
|
assert.True(t, result[ResourceConfig][ActionManage])
|
|
})
|
|
t.Run("RoleVisitor", func(t *testing.T) {
|
|
result := Rules.Grants(RoleVisitor)
|
|
assert.False(t, result[ResourcePhotos][ActionUpdate])
|
|
assert.False(t, result[ResourceConfig][ActionManage])
|
|
})
|
|
}
|