Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion transformer_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func convertObjectToJSONMap(res *Resource, context *Context, value interface{},
case reflect.Struct:
var metas []*Meta
if kind == "index" {
metas = res.ConvertSectionToMetas(res.allowedSections(res.IndexAttrs(), context, roles.Update))
metas = res.ConvertSectionToMetas(res.allowedSections(res.IndexAttrs(), context, roles.Read))
} else if kind == "edit" {
metas = res.ConvertSectionToMetas(res.allowedSections(res.EditAttrs(), context, roles.Update))
} else if kind == "show" {
Expand Down
2 changes: 1 addition & 1 deletion transformer_xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var XMLMarshalDefaultHandler = func(xmlStruct XMLStruct, e *xml.Encoder, start x
metas := []*Meta{}
switch xmlStruct.Action {
case "index":
metas = res.ConvertSectionToMetas(res.allowedSections(res.IndexAttrs(), context, roles.Update))
metas = res.ConvertSectionToMetas(res.allowedSections(res.IndexAttrs(), context, roles.Read))
case "edit":
metas = res.ConvertSectionToMetas(res.allowedSections(res.EditAttrs(), context, roles.Update))
case "show":
Expand Down