From d21cd72f7cd977b133b7f0ec22b95dc732e727b2 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Thu, 17 Sep 2020 20:56:21 +0200 Subject: [PATCH] Simplify access to system user service --- compose/rest/record.go | 2 +- compose/service/notification.go | 4 +--- compose/service/service.go | 11 ----------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/compose/rest/record.go b/compose/rest/record.go index 0ed4b522f..aa3c41137 100644 --- a/compose/rest/record.go +++ b/compose/rest/record.go @@ -65,7 +65,7 @@ func (Record) New() *Record { ac: service.DefaultAccessControl, // See comment at DefaultSystemUser definition - userFinder: service.DefaultSystemUser, + userFinder: systemService.DefaultUser, } } diff --git a/compose/service/notification.go b/compose/service/notification.go index 3be1f73e7..fa544cdd9 100644 --- a/compose/service/notification.go +++ b/compose/service/notification.go @@ -39,9 +39,7 @@ type ( func Notification() *notification { return ¬ification{ actionlog: DefaultActionlog, - - // See comment at DefaultSystemUser definition - users: DefaultSystemUser, + users: systemService.DefaultUser, } } diff --git a/compose/service/service.go b/compose/service/service.go index 08616c7c9..5ad9f5be3 100644 --- a/compose/service/service.go +++ b/compose/service/service.go @@ -16,7 +16,6 @@ import ( "github.com/cortezaproject/corteza-server/pkg/options" "github.com/cortezaproject/corteza-server/pkg/permissions" "github.com/cortezaproject/corteza-server/store" - systemService "github.com/cortezaproject/corteza-server/system/service" "go.uber.org/zap" "strconv" "time" @@ -66,14 +65,6 @@ var ( DefaultAttachment AttachmentService DefaultNotification *notification - // DefaultSystemUser is a bridge to users in a system service - // @todo this is ad-hoc solution that connects compose to system it breaks microservice - // architecture and service separation and should be refactored properly - // (that is, if we want to continue with microservice architecture) - DefaultSystemUser systemService.UserService - //DefaultSystemUser *systemUser - //DefaultSystemRole *systemRole - // wrapper around time.Now() that will aid service testing now = func() *time.Time { c := time.Now() @@ -159,8 +150,6 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) DefaultNamespace = Namespace() DefaultModule = Module() - DefaultSystemUser = systemService.DefaultUser - DefaultImportSession = ImportSession() DefaultRecord = Record() DefaultPage = Page()