Remove ownership from data privacy module response
This commit is contained in:
@@ -18,10 +18,6 @@ type (
|
||||
FindByID(ctx context.Context, ID uint64) (q *sysTypes.DalConnection, err error)
|
||||
}
|
||||
|
||||
moduleSetPayload struct {
|
||||
Set []types.PrivacyModule `json:"set"`
|
||||
}
|
||||
|
||||
DataPrivacyService interface {
|
||||
FindModules(ctx context.Context, filter types.PrivacyModuleFilter) (types.PrivacyModuleSet, types.PrivacyModuleFilter, error)
|
||||
}
|
||||
@@ -83,7 +79,6 @@ func (svc dataPrivacy) FindModules(ctx context.Context, filter types.PrivacyModu
|
||||
ID: m.ID,
|
||||
Name: m.Name,
|
||||
Handle: m.Handle,
|
||||
Owner: m.Owner,
|
||||
Connection: c,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/pkg/auth"
|
||||
"github.com/cortezaproject/corteza-server/pkg/dal"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/compose/service/event"
|
||||
@@ -442,8 +441,6 @@ func (svc module) FindSensitive(ctx context.Context, filter types.PrivacyModuleF
|
||||
return err
|
||||
}
|
||||
|
||||
identity := auth.GetIdentityFromContext(ctx).Identity()
|
||||
|
||||
for _, m := range mm {
|
||||
isPrivate := false
|
||||
for _, f := range m.Fields {
|
||||
@@ -453,12 +450,10 @@ func (svc module) FindSensitive(ctx context.Context, filter types.PrivacyModuleF
|
||||
}
|
||||
|
||||
if isPrivate && m != nil {
|
||||
ownedBy, _ := m.ModelConfig.SystemFieldEncoding.OwnedBy.Value()
|
||||
set = append(set, types.PrivacyModule{
|
||||
ID: m.ID,
|
||||
Name: m.Name, // @todo get this as per translation
|
||||
Handle: m.Handle,
|
||||
Owner: ownedBy == identity,
|
||||
ConnectionID: m.ModelConfig.ConnectionID,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -10,10 +10,9 @@ type (
|
||||
ID uint64 `json:"moduleID,string"`
|
||||
Name string `json:"name"`
|
||||
Handle string `json:"handle"`
|
||||
Owner bool `json:"owner"`
|
||||
|
||||
ConnectionID uint64 `json:"-"`
|
||||
Connection *sysTypes.DalConnection
|
||||
ConnectionID uint64 `json:"-"`
|
||||
Connection *sysTypes.DalConnection `json:"connection"`
|
||||
}
|
||||
|
||||
PrivacyModuleFilter struct {
|
||||
|
||||
Reference in New Issue
Block a user