mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-13 18:45:27 -04:00
fix: missing returns
This commit is contained in:
@@ -159,7 +159,7 @@ func Server(cfg *config.Config) *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
service, err := font.NewService(
|
||||
fontService, err = font.NewService(
|
||||
font.ServiceOptions{}.
|
||||
WithFontFS(fontFS).
|
||||
WithRootURI(fontServiceRootURI).
|
||||
@@ -170,8 +170,6 @@ func Server(cfg *config.Config) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fontService = service
|
||||
}
|
||||
|
||||
var notificationService notification.Service
|
||||
@@ -181,15 +179,16 @@ func Server(cfg *config.Config) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
service, err := notification.NewService(
|
||||
notificationService, err = notification.NewService(
|
||||
notification.ServiceOptions{}.
|
||||
WithLogger(logger).
|
||||
WithGatewaySelector(gatewaySelector).
|
||||
WithEventPublisher(natsStream).
|
||||
WithMachineAuthAPIKey(cfg.MachineAuthAPIKey),
|
||||
)
|
||||
|
||||
notificationService = service
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// start HTTP server
|
||||
|
||||
@@ -89,6 +89,7 @@ func (s Service) DeleteFont(w http.ResponseWriter, r *http.Request) {
|
||||
gatewayClient, err := s.gatewaySelector.Next()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
_, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationManageFonts)
|
||||
@@ -282,6 +283,7 @@ func (s Service) UploadFont(w http.ResponseWriter, r *http.Request) {
|
||||
gatewayClient, err := s.gatewaySelector.Next()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
_, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationManageFonts)
|
||||
|
||||
@@ -72,6 +72,7 @@ func (s Service) HandleNotification(w http.ResponseWriter, r *http.Request) {
|
||||
gatewayClient, err := s.gatewaySelector.Next()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
requestUser, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationPublishNotification)
|
||||
|
||||
@@ -19,7 +19,6 @@ func (s eventsNotifier) handleResourceMention(e ocEvents.ResourceMention, eventI
|
||||
Str("event", "Mention").
|
||||
Str("resourceid", e.Ref.GetResourceId().GetOpaqueId()).
|
||||
Logger()
|
||||
_ = logger
|
||||
gatewayClient, err := s.gatewaySelector.Next()
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -86,7 +86,7 @@ func CollaborationManageFontsPermission(c settingsmsg.Permission_Constraint) *se
|
||||
}
|
||||
}
|
||||
|
||||
// CollaborationPublishNotificationPermission is the permission to manage fonts
|
||||
// CollaborationPublishNotificationPermission is the permission to publish collaboration notifications
|
||||
func CollaborationPublishNotificationPermission(c settingsmsg.Permission_Constraint) *settingsmsg.Setting {
|
||||
return &settingsmsg.Setting{
|
||||
Id: "43e5948e-8238-41d6-9ef1-f259f00591db",
|
||||
|
||||
Reference in New Issue
Block a user