# Bug SPAR-136 - In add relation dialog, selecting a WP that user doesn't have permission to edit raises an error

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.3.1 |
| 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 |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

*Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:*

1.  Login as a user without permissions(edit WP) to Project A and with permissions in Project B

2.  Go to the workpackages page of Project B

3.  Select a WP

4.  Go to relations tab

5.  Try to add an existing child for the WP

6.  Select a WP from Project A

### What is the buggy behavior?

*Please describe the bug in as much detail as possible. Example:*

  - Change the error message to an inline-validation

  - Change the message to "Cannot add child because work package is read-only."

### What is the expected behavior?

*Describe how the application should behave like. Example:*

1.  There shouldn't be an error

2.  Avoid showing all relations to a user with restricted permissions. (?)

<br>

### Environment information

*Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs*

**OpenProject installation type**

  - Hosted cloud edition

  - Packaged installation
    
      - What distribution?

  - Docker All-in-one container

  - Docker-compose installation

  - Other (please specify)

**OpenProject version**

*If you're not running on the cloud edition, please specify the version of OpenProject you're running. Example: v12.1.5*

**Browser**

- [x] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [ ] Windows
- [x] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

*Please specify the browser language and the language of the OpenProject user for which the bug occurred.*
