Globals Access Control

You can define Global-level Access Control within each Global's access property. All Access Control functions accept one args argument.

**Available argument properties:

Available Controls

FunctionAllows/Denies Access
readUsed in the findOne Global operation
updateUsed in the update Global operation

Example Global config:

export default {
slug: "header",
access: {
read: ({ req: { user } }) => { ... },
update: ({ req: { user } }) => { ... },
},
};

Read

Returns a boolean result to allow or deny a user's ability to read the Global.

Available argument properties:

OptionDescription
reqThe Express request object containing the currently authenticated user

Update

Returns a boolean result to allow or deny a user's ability to update the Global.

Available argument properties:

OptionDescription
reqThe Express request object containing the currently authenticated user
Next

Uploads