mirror of
https://github.com/directus/directus.git
synced 2026-01-28 20:27:55 -05:00
Fix legacy permissions for M2O fields in GraphQL (#16430)
* Remove relation for legacy permission without allowed field * Remove deprecated formatError and improve error handling * Add unit test Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -85,7 +85,9 @@ export function reduceSchema(
|
||||
|
||||
if (
|
||||
relation.related_collection &&
|
||||
Object.keys(allowedFieldsInCollection).includes(relation.related_collection) === false
|
||||
(Object.keys(allowedFieldsInCollection).includes(relation.related_collection) === false ||
|
||||
// Ignore legacy permissions with an empty fields array
|
||||
allowedFieldsInCollection[relation.related_collection].length === 0)
|
||||
) {
|
||||
collectionsAllowed = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user