From 7aee458237d2a8820c574f03925a9f1a42388489 Mon Sep 17 00:00:00 2001 From: Joshua Bemenderfer <5861371+JoshTheDerf@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:43:55 -0500 Subject: [PATCH] Fix permission.ts compatibility with Directus 10.9.1+ --- src/composables/use-permissions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/composables/use-permissions.ts b/src/composables/use-permissions.ts index eff65a6..4afd8fe 100644 --- a/src/composables/use-permissions.ts +++ b/src/composables/use-permissions.ts @@ -57,10 +57,10 @@ export function usePermissions(collection: Ref, item: Ref, isNew: R if (userStore.currentUser?.role?.admin_access === true) return fields; - const permissions = permissionsStore.getPermissionsForUser(collection.value, isNew.value ? 'create' : 'update'); + const permissions = permissionsStore.getPermission(collection.value, isNew.value ? 'create' : 'update'); // remove fields without read permissions so they don't show up in the DOM - const readableFields = permissionsStore.getPermissionsForUser(collection.value, 'read')?.fields; + const readableFields = permissionsStore.getPermission(collection.value, 'read')?.fields; if (readableFields && readableFields.includes('*') === false) { fields = fields.filter((field) => readableFields.includes(field.field)); }