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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user