Skip to content

Fix edit title and description permissions

Deepika Guliani requested to merge dg-439660-fix-permissions into master

What does this MR do and why?

Fix edit title and description permissions

Fixes - Edit buttons for epic work items not appearing ... (#439660 - closed)

:Behind work_items_mvc_2 FF

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot 2024-01-30 at 12.58.13 PM.png Screenshot 2024-01-30 at 12.59.31 PM.png

How to set up and validate locally

  1. Enable :work_items_mvc_2 FF
  2. Apply the below patch
diff --git a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
index cd2721a635fd..2f10f1d4403c 100644
--- a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
+++ b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
@@ -65,7 +65,7 @@ export default {
return this.workItem.workItemType?.name;
},
canUpdate() {
-      return this.workItem?.userPermissions?.updateWorkItem;
+      return false;
},
canDelete() {
return this.workItem?.userPermissions?.deleteWorkItem;
diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue
index 897063c4ad35..884d9408d84e 100644
--- a/app/assets/javascripts/work_items/components/work_item_detail.vue
+++ b/app/assets/javascripts/work_items/components/work_item_detail.vue
@@ -164,7 +164,7 @@ export default {
return this.workItem.workItemType?.id;
},
canUpdate() {
-      return this.workItem.userPermissions?.updateWorkItem;
+      return false;
},
canDelete() {
return this.workItem.userPermissions?.deleteWorkItem;
  1. See that none of the edit buttons are available when there are no permissions to update the work item

Merge request reports

Loading