I'm writing an API to use with _protect
that will check the users returned account against a YAML list provided in the page's front matter.
For example, in my "beta feature" page I have this YAML:
accounts:
- abc
- def
- ghi
My protect statement looks like this:
_protect:
allow:
_addon:
method: 'labs:account'
comparison: '='
value: 1
The account
method will use our API to find the users account. If the returned account matches the passed list, it will return 1
, if not...no access.
My quyestion is:
How can I get the accounts list from the page for each page on which the labs:account
method is being called?