I would like to only show selected public fields on the public API get of a collection.
So e.g. the following collection entry
{
Name: "Item name",
Stream: "http://example.com/guid",
Image: {
path: "/2018/05/02/5ae99e452a072Anna.jpg",
title: "Anna.jpg",
mime: "image/jpeg",
description: "",
tags: [ ],
size: 446990,
image: true,
video: false,
audio: false,
archive: false,
document: false,
code: false,
created: 1525259845,
modified: 1525259845,
_by: "5ae99d2fef8b3doc343583183",
width: 1944,
height: 2592,
colors: [
"2b1911",
"c68f77",
917164,
"947c6c",
"9c2020"
],
_id: "5ae99e4543ad5doc1315561261"
},
_mby: "5ae99d2fef8b3doc343583183",
_by: "5ae99d2fef8b3doc343583183",
_modified: 1525260039,
_created: 1525259852,
_id: "5ae99e4ccf48bdoc85498314",
_order: 0
},
I would like to present as below on the public API:
{
name: "Item name",
stream: "http://example.com/guid",
Image: {
path: "/2018/05/02/5ae99e452a072Anna.jpg",
width: 1944,
height: 2592,
_id: "5ae99e4543ad5doc1315561261"
},
_order: 0
},
I would like to map private fields to public fields or aliases per entry for the complete collection.
Does Cockpit come with functionality for this?
I guess you can do something with the Collections > Collection: [Permission Tab] (read chip) <?php options. But I cannot find any documentation for this.
Can you point me to some documentation or share an example here?