[x] It appears that there was a cannotBeDirectMessaged permission that was not declared anywhere and was always false (but for admin every permission is true). 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.
[x] In addition, in this PR, I extended the types of the User model for type hints:
Reviewers should focus on:
To reproduce:
Give Create private discussions with users that block it for non-admin user
Login to that user account
Go to user profile that blocks PD's
On the current version of this extension, there is no button to create PD
Check this PR, there will be now button to create PD if user has appropriate permissions
Screenshots
Confirmed
[x] Frontend changes: tested on a local Flarum installation.
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
Confirmed