enhancement: make use of unifiedrole from the graph invitation endpoint, applying multiple roles works and result in a merged cs3 permission set (#7751)

This commit is contained in:
Florian Schade
2023-11-23 14:18:03 +01:00
committed by GitHub
parent 74f1b2c56d
commit 40d356c56b
9 changed files with 377 additions and 52 deletions
+1 -11
View File
@@ -5,24 +5,14 @@ import (
"sync/atomic"
"github.com/go-playground/validator/v10"
libregraph "github.com/owncloud/libre-graph-api-go"
)
var defaultValidator atomic.Value
var structMapValidations = map[any]map[string]string{
&libregraph.DriveItemInvite{}: {
"Recipients": "min=1",
"Roles": "len=1", // currently it is not possible to set more than one role
"ExpirationDateTime": "omitnil,gt",
},
}
func init() {
v := validator.New()
for s, rules := range structMapValidations {
v.RegisterStructValidationMapRules(rules, s)
}
initLibregraph(v)
defaultValidator.Store(v)
}