Fix archive button permissions check

Fixes #900
This commit is contained in:
rijkvanzanten
2020-11-06 14:57:44 -05:00
parent ee5211ce02
commit dd803a915b
4 changed files with 26 additions and 8 deletions

View File

@@ -26,9 +26,14 @@ export function usePermissions(collection: Ref<string>, item: Ref<any>, isNew: R
const archiveAllowed = computed(() => {
if (!collectionInfo.value?.meta?.archive_field) return false;
return isAllowed(collection.value, 'update', {
[collectionInfo.value.meta.archive_field]: collectionInfo.value.meta.archive_value,
});
return isAllowed(
collection.value,
'update',
{
[collectionInfo.value.meta.archive_field]: collectionInfo.value.meta.archive_value,
},
true
);
});
const fields = computed(() => {