3
0

Simplify access to system user service

This commit is contained in:
Denis Arh 2020-09-17 20:56:21 +02:00
parent d8d48c2cfe
commit d21cd72f7c
3 changed files with 2 additions and 15 deletions

View File

@ -65,7 +65,7 @@ func (Record) New() *Record {
ac: service.DefaultAccessControl,
// See comment at DefaultSystemUser definition
userFinder: service.DefaultSystemUser,
userFinder: systemService.DefaultUser,
}
}

View File

@ -39,9 +39,7 @@ type (
func Notification() *notification {
return &notification{
actionlog: DefaultActionlog,
// See comment at DefaultSystemUser definition
users: DefaultSystemUser,
users: systemService.DefaultUser,
}
}

View File

@ -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()