diff --git a/frontend/src/composables/lockedit.ts b/frontend/src/composables/lockedit.ts
index 04ad0320a..534b1cd48 100644
--- a/frontend/src/composables/lockedit.ts
+++ b/frontend/src/composables/lockedit.ts
@@ -173,6 +173,8 @@ export function useProjectTypeLockEdit(options: {
projectType: Ref
,
performSave?: (data: ProjectType) => Promise;
performDelete?: (data: ProjectType) => Promise;
+ hasEditPermissions?: ComputedRef;
+ errorMessage?: ComputedRef;
}) {
const auth = useAuth();
const projectType = computed(() => options.projectType.value);
@@ -184,11 +186,17 @@ export function useProjectTypeLockEdit(options: {
});
const hasEditPermissions = computed(() => {
+ if (options.hasEditPermissions && !options.hasEditPermissions.value) {
+ return false;
+ }
return (projectType.value.scope === ProjectTypeScope.GLOBAL && auth.permissions.value.designer) ||
- (projectType.value.scope === ProjectTypeScope.PRIVATE && auth.permissions.value.private_designs) ||
- (projectType.value.scope === ProjectTypeScope.PROJECT && projectType.value.source === SourceEnum.CUSTOMIZED);
+ (projectType.value.scope === ProjectTypeScope.PRIVATE && auth.permissions.value.private_designs) ||
+ (projectType.value.scope === ProjectTypeScope.PROJECT && projectType.value.source === SourceEnum.CUSTOMIZED);
});
const errorMessage = computed(() => {
+ if (options.errorMessage?.value) {
+ return options.errorMessage.value;
+ }
if (projectType.value.scope === ProjectTypeScope.PROJECT) {
if (projectType.value.source === SourceEnum.SNAPSHOT) {
return `This design cannot be edited because it is a snapshot from ${projectType.value.created.split('T')[0]}.`
diff --git a/frontend/src/pages/designs/[projectTypeId]/findingfields.vue b/frontend/src/pages/designs/[projectTypeId]/findingfields.vue
index a5bf8694d..d7e83de75 100644
--- a/frontend/src/pages/designs/[projectTypeId]/findingfields.vue
+++ b/frontend/src/pages/designs/[projectTypeId]/findingfields.vue
@@ -95,7 +95,7 @@