Fix: "Create private discussions with users that block it" permission not working for non-admin users #194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
startPrivateDiscussionWithBlockers
permission keycannotBeDirectMessaged
permission that was not declared anywhere and was alwaysfalse
(but for admin every permission istrue
). Because of this, for example, a moderator who has the permission to create private discussions with users who are blocking them could not create a private discussion with such a user despite having the permission.Reviewers should focus on:
To reproduce:
Create private discussions with users that block it
for non-admin userScreenshots
![image](https://private-user-images.githubusercontent.com/25438601/300177355-6886e28e-a100-4f90-b090-cb61c79450ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwNTk3NzEsIm5iZiI6MTcyNjA1OTQ3MSwicGF0aCI6Ii8yNTQzODYwMS8zMDAxNzczNTUtNjg4NmUyOGUtYTEwMC00ZjkwLWIwOTAtY2I2MWM3OTQ1MGFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDEyNTc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1NzFjM2Q5ZDZjNTZlZmM0YWVjN2YxZDEwYWI3MDczNTg5ZGM5NGNhNzIxNjVmZjRmMzI4ZjRhMDhmZTFiYzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Zn6GdsfaV0kMucVEpo14Oq0Seq45BpdC2hsH1GRWfmo)
Confirmed