Develop Mini Blog with Directus - Part 3

directus | Directus, Headless CMS NextJS | 2024-10-22

Pre-requisite

  • Basic understanding about Directus and NextJS

Mini Blog Series

We are preparing access permission for NextJS App

What access policies to setup?

First we need to understand the goal - the goal is to allow NextJS to consume the blog content and images.

Hence, we know there are 2 collections to set in Directus access policies.


Set directus_files to Public policy with READ access

Screenshot1


Create a new policy name Presentation

Set blog with READ access, without App and Admin Access

Screenshot2


Create a Role, name Presentation and adopt Presentation Policy

Screenshot3


Lastly, create a bot user, set

  • Status = Active
  • Role = Presentation
  • Generate security token

Screenshot4


Keep the security token, that will be use for NextJS to communicate with Directus CMS.


References