Policies
Directus v11 contains a brand new permissions system that's based on policies. We've provided a migration, so the upgrade path is the same as with other releases. This is a big release, which changes the paradigm on how permissions are attached and executed. Please make a database backup before upgrading your version of Directus.
⚠️ Potential Breaking Changes
- @directus/app
- Added a new policy based permissions system (#22773 by @rijkvanzanten)
- @directus/api
- Replaced the database client library
mysql
withmysql2
, used for MySQL/MariaDB (#22534 by @paescuj) - Added a new policy based permissions system (#22773 by @rijkvanzanten)
- Replaced the database client library
- @directus/extensions
- Changed module
preRegisterCheck
signature to align with the changes made for Policies (#22773 by @rijkvanzanten)
- Changed module
- @directus/system-data
- Added new collections and fields and updated existing fields and permissions needed for Policies (#22773 by @rijkvanzanten)
- @directus/types
- Added new types and modified existing types required for Policies (#22773 by @rijkvanzanten)
- @directus/utils
- Added new dynamic variables to
parseFilter
and added theprocessChunk
helper (#22773 by @rijkvanzanten)
- Added new dynamic variables to
✨ New Features & Improvements
- @directus/api
- Updated WebSocket subscriptions to include the new policies collection (#22773 by @rijkvanzanten)
- Used explicit headings for CSV export (#23140 by @jaads)
- Implemented new GraphQL queries for policies (#22773 by @rijkvanzanten)
- @directus/constants
- Added permission actions constant (#22773 by @rijkvanzanten)
- @directus/sdk
- Implemented new SDK functions for policies (#22773 by @rijkvanzanten)
- @directus/memory
- Added new
clear
method to cache implementations (#22773 by @rijkvanzanten)
- Added new
- @directus/errors
- Added error extension to the
ForbiddenError
(#22773 by @rijkvanzanten)
- Added error extension to the
🐛 Bug Fixes & Optimizations
- @directus/app
- Ensured collections in system permissions interface are scrolled into view when added but out of view (#23036 by @paescuj)
- Ensured the permissions table under policies is displayed correctly on mobile devices (#22985 by @paescuj)
- Fixed table layout default query, to not include presetational fields (#22840 by @hanneskuettner)
- Fixed missing policies in public role policy selection (#23192 by @hanneskuettner)
- @directus/api
- Fixed
groupBy
behavior that resulted in an internal server error when used with relational item permissions (#23185 by @hanneskuettner) - Fixed an issue that would cause the API to return an error when a root field in a m2a builder was queried (#23181 by @rijkvanzanten)
- Fixed
reduceSchema
to strip out collection the user does not have access to (#22916 by @hanneskuettner) - Fixed user counting where users were double counted and inactive users with policies were counted as well (#23184 by @rijkvanzanten)
- Fixed filter creation in
fetchPolicies
for users without roles (#22936 by @hanneskuettner) - Fixed aggregation field existence and permission checks (#23022 by @hanneskuettner)
- Fixed down migration erroring on post migration permissions (#23097 by @ComfortablyCoding)
- Fixed permission checking for o2m related fields (#23199 by @hanneskuettner)
- Ensured that policies attached to a user, role and parent roles are correctly prioritized (#22967 by @paescuj)
- Ensured the default
DB_FILENAME
option from the Docker Image is not applied when using MySQL/MariaDB, fixing a corresponding warning (#22970 by @cliqer) - Fixed the policies migration for the case where permissions had been configured for the public role (#22811 by @paescuj)
- Fix query error on some DB vendors when using multi relation sort (#22872 by @hanneskuettner)
- Migrated
NotificationsService
to new policies system (#22914 by @hanneskuettner) - Fixed broken permissions for sorting of aggregate query when using the aggregate result as sort field (#23193 by @hanneskuettner)
- Fixed an issue where keys in filter operand objects where incorrectly checked for field permissions (#22915 by @hanneskuettner)
- Fixed
📦 Published Versions
@directus/app@13.0.0
@directus/api@22.0.0
@directus/components@1.0.0
@directus/composables@11.0.0
@directus/constants@12.0.0
create-directus-extension@11.0.0
create-directus-project@11.0.0
@directus/env@2.0.0
@directus/errors@1.0.0
@directus/extensions@2.0.0
@directus/extensions-registry@2.0.0
@directus/extensions-sdk@12.0.0
@directus/format-title@11.0.0
@directus/memory@2.0.0
@directus/pressure@2.0.0
@directus/random@1.0.0
@directus/release-notes-generator@1.0.0
@directus/schema@12.0.0
@directus/specs@11.0.0
@directus/storage@11.0.0
@directus/storage-driver-azure@11.0.0
@directus/storage-driver-cloudinary@11.0.0
@directus/storage-driver-gcs@11.0.0
@directus/storage-driver-local@11.0.0
@directus/storage-driver-s3@11.0.0
@directus/storage-driver-supabase@2.0.0
@directus/stores@1.0.0
@directus/system-data@2.0.0
@directus/themes@1.0.0
@directus/tsconfig@2.0.0
@directus/types@12.0.0
@directus/update-check@12.0.0
@directus/utils@12.0.0
@directus/validation@1.0.0
@directus/sdk@17.0.0