Add namespaceID to loaded module-field resource for eval permissions
This commit is contained in:
committed by
Jože Fortun
parent
0c08742a40
commit
55fadaa535
@@ -1064,11 +1064,14 @@ func loadModuleField(ctx context.Context, s store.Storer, namespaceID, moduleID,
|
||||
err = ModuleErrNotFound()
|
||||
}
|
||||
|
||||
if err == nil && (namespaceID != res.NamespaceID || moduleID != res.ModuleID) {
|
||||
// Make sure chart belongs to the right namespace
|
||||
if err == nil && (moduleID != res.ModuleID) {
|
||||
// Make sure module-field belongs to the right module
|
||||
return nil, ModuleErrNotFound()
|
||||
}
|
||||
|
||||
// add namespace ID on the module-field
|
||||
res.NamespaceID = namespaceID
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ type (
|
||||
// Modules - CRM module definitions
|
||||
ModuleField struct {
|
||||
ID uint64 `json:"fieldID,string"`
|
||||
NamespaceID uint64 `json:"namspaceID,string"`
|
||||
NamespaceID uint64 `json:"namespaceID,string"`
|
||||
ModuleID uint64 `json:"moduleID,string"`
|
||||
Place int `json:"-"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user