Home / Companies / Strapi / Blog / Post Details
Content Deep Dive

From Zero to Hero: Getting Started with GraphQL, Strapi and Next.js 16 Part 4

Blog post from Strapi

Post Details
Company
Date Published
Author
Paul Bratslavsky
Word Count
13,071
Language
English
Hacker News Points
-
Summary

In the final part of a series on building a note-taking application with GraphQL, Strapi v5, and Next.js 16, the focus is on implementing user-specific content access and authorization. The tutorial details how to ensure each user can only view and modify their own notes by using Strapi's users-permissions plugin for JWT-based authentication and a Document Service middleware for enforcing ownership rules on both REST and GraphQL APIs. The middleware automatically assigns an owner to each note upon creation and filters read operations to return only the signed-in user's notes, while also blocking unauthorized updates and deletions. This approach centralizes data protection across all entry points, eliminating the need for duplicated logic. The tutorial further explains how to integrate these functionalities into a Next.js frontend, including user registration, login, and navigation, with JWTs stored in HTTP-only cookies for security. The series concludes with suggestions for extending this foundation to include features like shared notes and enhanced role-based permissions.