only allow admins to set global notifications

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-07-07 11:06:53 +02:00
parent bca4d4f9fd
commit 6ab2f10386
6 changed files with 73 additions and 3 deletions
@@ -31,6 +31,7 @@ type Options struct {
GatewaySelector pool.Selectable[gateway.GatewayAPIClient]
HistoryClient ehsvc.EventHistoryService
ValueClient settingssvc.ValueService
RoleClient settingssvc.RoleService
RegisteredEvents []events.Unmarshaller
}
@@ -128,3 +129,10 @@ func Value(vs settingssvc.ValueService) Option {
o.ValueClient = vs
}
}
// Roles provides a function to configure the roles service client
func Role(rs settingssvc.RoleService) Option {
return func(o *Options) {
o.RoleClient = rs
}
}
@@ -77,6 +77,7 @@ func Server(opts ...Option) (http.Service, error) {
svc.HistoryClient(options.HistoryClient),
svc.GatewaySelector(options.GatewaySelector),
svc.ValueClient(options.ValueClient),
svc.RoleClient(options.RoleClient),
svc.RegisteredEvents(options.RegisteredEvents),
)
if err != nil {