Our Visual Editing feature is live! 🎉 Learn more
Directus Logo
  • Use Cases and Features
    • Headless CMS
      Manage and deliver content with ease
    • Backend-as-a-Service
      Build and ship applications faster
    • Headless Commerce
      A single source of truth for products
    • 100+ More Use Cases
      Build anything (or everything)
    • Instant APIs
      Connect a database, get REST + GraphQL APIs
    • Granular Policy-Based Auth
      Provide secure, autonomous data access
    • Visual Automation Builder
      Automate content and data workflows with ease
    • 50+ More Features
      Get everything you need out-of-the-box
    Project Showcase
    Built With Directus

    Built With Directus

    See what everyone's been building with Directus

  • Learn More
    • Blog
      Read our latest articles and guides
    • Case Studies
      Case studies and success stories
    • Community
      Join our 13k member Discord community.
    • Agency Directory
      Browse our list of agency partners
    • About Us
      Learn more about Directus and the team
    • Wall of Love
      See what others are saying about us
    • Contact
      Have a general inquiry or question for us?
    • Support
      Reach out to Directus support
    Watch Directus TV
    Directus TV
    Video

    Directus TV

    Go down the rabbit hole with hours of original video content from our team.

  • Developers
  • Enterprise
  • Pricing
Chat With UsGet Started Free
GitHub logo30,483
Back
product
Wednesday, August 7, 2024

Introducing Policies: A New Approach To Permissions

Directus 11 introduces a powerful new permissions system based on policies, offering granular access control and improved flexibility.

The headline feature of Directus 11 is the brand new permissions system based on policies. This is a big shift in how Directus handles access control, giving you more power and flexibility than ever before.

Policies are essentially sets of rules that determine what users can and can't do in your Directus projects. They can be attached to users or roles, allowing for incredibly fine-grained control over permissions.

Here's what makes policies special:

  1. Granular Control. You can now set permissions for specific fields, items, or even combinations of conditions.
  2. Inheritance. Policies don’t override each other, instead they are additive, with permissions coming from all applied policies. That means that policies, be it from a role or a user, are added together and you get the combination of all the permissions set in each of the policies.
  3. Dynamic Variables. Policies can use dynamic variables like $CURRENT_USER or $CURRENT_ROLE, making it easy to create context-aware permissions that adapt to who's making the request.
  4. Simplified Management. Despite their power, policies are designed to be easier to manage than the old permissions system. You can create, edit, and assign them through both the API and the Data Studio interface.

Policies 1

A Real-Life Example of Policies in Action

Let’s say you’re a content manager for a international ecommerce site. You need to restrict editors' access to product information based on their geographical region, while still allowing them to view but not edit global brand information.

Here's how policies in Directus 11 could solve this:

  1. Create a policy that grants full access to product information for a specific region.
  2. Attach this policy to roles corresponding to each regional team.
  3. Create another policy that allows read-only access to the global brand information collection.
  4. Attach this policy to all editor roles.
  5. Use dynamic variables like $CURRENT_USER to limit the visible sales figures to the users office location that is stored in the Directus user item.

This setup allows you to:

  • Maintain data integrity by ensuring editors only modify products relevant to their region
  • Share global brand information across all teams without risk of unauthorized changes
  • Easily adjust permissions as your team’s structure or needs change

We've put a lot of work into making the transition to policies as smooth as possible. The upgrade process includes a migration that will convert your existing permissions to the new policy-based system.

This new system opens up a world of possibilities for access control in Directus. Whether you're running a simple blog or a complex multi-tenant application, policies give you the tools to implement exactly the permission structure you need.

What else is in Directus 11?

While policies steal the spotlight, Directus 11 packs in several other noteworthy updates:

  • We've switched to mysql2 for MySQL/MariaDB connections, boosting performance.
  • New GraphQL queries and SDK functions for policies are now available.
  • We've added a new clear method to cache implementations.

We've also squashed a few bugs from our 11 RC, including fixes for groupBy behavior, aggregation queries, and permissions checks for related fields.

Directus 11 is available now!

Directus 11 is ready for action. You can pull the latest version from Docker Hub or install it via npm right now. As always, we recommend backing up your database before upgrading, especially given the significant changes in this release.

Check out the complete release notes on GitHub for an in-depth look at all the changes, improvements, and fixes in Directus 11.

We can't wait to see what you'll build with these powerful new features. Dive in and let us know what you think in our Discord community at https://directus.chat.

 

Posted By

Christina Harker

Christina Harker

Director, Product Marketing

Share

LinkedIn LogoTwitter LogoReddit LogoDev.to Logo

Sign up for updates 🐇

Get insights, releases, and exciting news delivered directly to your inbox once a month. No spam - we promise. 🙂

Related

Introducing Spreadsheet Layout in Directus Explore

Jun 17, 2024

How Ripley Entertainment Used Directus to Revamp Their Digital Presence

Jul 2, 2024

Introducing Directus 11: Release Candidate with Policies

Jun 17, 2024

  • Directus LogoDirectus Logo

    A composable backend to build your Headless CMS, BaaS, and more. 

  • Solutions
    • Headless CMS
    • Backend-as-a-Service
    • Product Information
    • 100+ Things to Build
  • Resources
    • Documentation
    • Guides
    • Community
    • Release Notes
  • Support
    • Issue Tracker
    • Feature Requests
    • Community Chat
    • Cloud Dashboard
  • Organization
    • About
    • Careers
    • Brand Assets
    • Contact
©2025 Monospace Inc
  • Cloud Policies
  • License
  • Terms
  • Privacy