Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: "Create private discussions with users that block it" permission not working for non-admin users #194

Conversation

rafaucau
Copy link
Contributor

@rafaucau rafaucau commented Jan 27, 2024

Changes proposed in this pull request:

  • Fixed startPrivateDiscussionWithBlockers permission key
  • 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.
  • In addition, in this PR, I extended the types of the User model for type hints:
    image

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
image

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes.

@imorland imorland merged commit d13b4ab into FriendsOfFlarum:master Feb 8, 2024
20 checks passed
@rafaucau rafaucau deleted the fix/create_private_discussions_with_users_that_block_it branch February 8, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants