Ghost/core/shared
Kevin Ansfield c36e749820
Added support for gating content by member labels and products (#12946)
refs https://github.com/TryGhost/Team/issues/581
closes https://github.com/TryGhost/Team/issues/582

Emails can now be sent to members with specific associated labels or products by specifying an NQL string. We want to bring the same members segment feature to content by allowing `visibility` to be an NQL filter string on top of the `public/members/paid` special-case strings.

As an example it's possible to set `posts.visibility` to `label:vip` to make a post available only to those members with the `vip` label.

- removed enum validations for `visibility` so it now accepts any string or `null`
    - bumped `@tryghost/admin-api-schema` for API-level validation changes
- added nql validation to API input validators by running the visibility query against the members model
- added transform of NQL to special-case visibility values when saving post model
    - ensures there's a single way of representing "members" and "paid" where NQL gives multiple ways of representing the same segment
    - useful for keeping theme-level checks such as `{{#has visibility="paid"}}` working as expected
- updated content-gating to parse nql from post's visibility and use it to query the currently logged in member to see if there's a match
    - bumped @tryghost/members-api to include label and product data when loading member
2021-05-10 19:32:11 +01:00
..
config Updated Portal to handle custom products/prices 2021-05-10 23:15:49 +05:30
i18n Added support for gating content by member labels and products (#12946) 2021-05-10 19:32:11 +01:00
express.js Added Router etc to shared/express + use everywhere 2020-05-01 19:32:57 +01:00
html-to-plaintext.js Added paywall card to mark end of free content preview (#12663) 2021-02-17 23:00:26 +00:00
logging.js Added ElasticSearch logging when available 2021-02-25 15:50:58 +00:00
sentry.js Moved Sentry noop function into block 2020-11-10 11:04:21 +00:00
url-utils.js Added default API version to config 2021-04-21 14:57:07 +01:00