You can define Global-level Access Control within each Global's access
property. All Access Control functions accept one args
argument.
**Available argument properties:
Function | Allows/Denies Access |
---|---|
read | Used in the findOne Global operation |
update | Used in the update Global operation |
Example Global config:
export default {slug: "header",access: {read: ({ req: { user } }) => { ... },update: ({ req: { user } }) => { ... },},};
Returns a boolean result to allow or deny a user's ability to read the Global.
Available argument properties:
Option | Description |
---|---|
req | The Express request object containing the currently authenticated user |
Returns a boolean result to allow or deny a user's ability to update the Global.
Available argument properties:
Option | Description |
---|---|
req | The Express request object containing the currently authenticated user |