check if perms have edits (#7599)

This commit is contained in:
Nitwel
2021-08-25 16:36:10 +02:00
committed by GitHub
parent 57442431d5
commit 9e46adb3b5

View File

@@ -111,7 +111,12 @@ export default defineComponent({
const permissionLevel = computed<'all' | 'none' | 'custom'>(() => {
if (permission.value === undefined) return 'none';
if (permission.value.fields?.includes('*')) return 'all';
if (
permission.value.fields?.includes('*') &&
Object.keys(permission.value.permissions || {}).length === 0 &&
Object.keys(permission.value.validation || {}).length === 0
)
return 'all';
return 'custom';
});