Skip to content

Add `create_note` ability to group level issues

Mario Celi requested to merge 425502-fix-permission-checks into master

What does this MR do and why?

Work items and issues can now be created at the group level. This change allows users with guest access, or any user on public groups, to create notes on issues or work items at the group level.

How to set up and validate locally

  1. Enable the feature flag in Rails console Feature.enable(:namespace_level_work_items)
  2. Create a group level work item with the following query at http://127.0.0.1:3000/-/graphql-explorer so you can fetch a work item in the next query
    mutation {
       workItemCreate(input: {namespacePath: "flightjs", title: "test group level work item", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}) {
         errors
         workItem {
           id
           iid
         }
       }
     }
  3. Fetch a wok item by IID and request the createNote user permission field
    {
       group(fullPath: "flightjs") {
         name
         workItem(iid: "<iid_returned_in_previus_mutation>") {
           id
           iid
           userPermissions {
             createNote
           }
         }
       }
     }
    Before this change, createNote should return false even if the user has access to the project

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #425502 (closed)

Edited by Mario Celi

Merge request reports

Loading