This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

Using apostrophe-headless, can I filter model properties for non-logged-in users?

I have an apostrophe-headless and a custom module served through it:

module.exports = {
  extend: 'apostrophe-pieces',
  name: 'book',
  label: 'Book',
  pluralLabel: 'Books',
  restApi: true,
  addFields: [
    {
      name: 'name',
      label: 'Name',
      type: 'string'
    },
    {
      name: 'description',
      label: 'Description',
      type: 'string',
      textarea: true
    },
    {
      name: 'author',
      label: 'Author',
      type: 'string'
    },
    {
      name: 'author_email',
      label: 'Author Email',
      type: 'string'
    }
  }
  ...
}

Is there a way to not return the author_email property if the user fetching it is not logged in?