# Bug SPAR-161 - Should not display "Delete relation" for child if lacking "Manage work package hierarchies" permission

Project: Stream Planning and Reporting
Status: closed
URL: https://community.openproject.org/work_packages/SPAR-161

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.4.0 |
| Observed in versions | 15.3.0 |
| Bug found in version (deprecated) | 15.3.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Behrokh Satarnejad |
| Product manager |  |
| Developers | Behrokh Satarnejad |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Create a project &quot;Everything allowed project&quot; with an admin
    
2.  Add a work package &quot;wp in everything allowed project&quot;
    
3.  Create a project &quot;Restricted project&quot; with an admin
    
4.  Add a work package &quot;restricted work package&quot; in that project
    
5.  Set the parent of &quot;restricted work package&quot; to be &quot;wp in everything allowed project&quot;
    
6.  Create a user &quot;Limited user&quot; with the following permissions:
    
    1.  all permissions on the project &quot;Everything allowed project&quot;
        
    2.  all permissions except &quot;Manage work package hierarchies&quot; on the project &quot;Restricted project&quot;
        
7.  With the user &quot;Limited user&quot;, go to the relations tab of work package &quot;wp in everything allowed project&quot;
    
8.  Look at the child relation to &quot;restricted work package&quot;
    

### What is the buggy behavior?

*   There is a three dots menu to delete the relation
    
*   Clicking that action does nothing, because it does not work: the user is lacking the &quot;Manage work package hierarchies&quot; permission (`:manage_hierarchies`)
    

### What is the expected behavior?

1.  The three dots menu is not present
    
2.  Bonus: when the three dots menu is not present, there should still be a gap between the info line (type, id) and the subject of the work package
    

Note: the three dots menu is correctly hidden when in a project where the user lacks the permission: in this example, if an admin creates a child for &quot;restricted work package&quot;, and the limited user visits that &quot;restricted work package&quot;, then the three dots menu will not be present.

### Screenshots and other files

The three dots menu from the child relation of &quot;wp in everything allowed project&quot; work package:

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/320097/content">

.

When the three dots menu is not displayed, the info line and the subject line to close from each other (did it by removing the &quot;Manage work package hierarchies&quot; permission to the limited user in &quot;Everything allowed project&quot; project:

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/320098/content">

### Environment information

**OpenProject version**

15.3
