Skip to content

[2.x] feat: select own post permission#122

Merged
imorland merged 7 commits into2.xfrom
im/own-post-permission
Dec 2, 2025
Merged

[2.x] feat: select own post permission#122
imorland merged 7 commits into2.xfrom
im/own-post-permission

Conversation

@imorland
Copy link
Copy Markdown
Member

@imorland imorland commented Dec 2, 2025

Fixes #0000

Changes proposed in this pull request:

Removes the previous Select own post as best answer setting and replaces it with tag scoped permissions, to allow for finer control over which users can perform this action

Reviewers should focus on:
Note the translation key change from fof-best-answer.admin.settings.allow_select_own_post to fof-best-answer.admin.permissions.allow_select_own_post

Screenshot

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

Required changes:

@imorland imorland requested a review from a team as a code owner December 2, 2025 07:43
@imorland imorland added the enhancement New feature or request label Dec 2, 2025
Copy link
Copy Markdown
Member

@DavideIadeluca DavideIadeluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you mentioned I think we need a migration here (especially considering the pending 1.x implementation) which:

  • If Select own post disabled, nothing needs to be done (admin by default, fully preserves backwards compatibility)
  • If Select own post enabled, grant member permissions globally and optionally on all tag scopes (should also be fully backwards compatible)

Also it appears like a change in the condition of adding the frontend controls are needed as currently the controls are added whilst the backend returns a 403 response:

Screen.Recording.2025-12-02.at.09.40.04.mov

@imorland
Copy link
Copy Markdown
Member Author

imorland commented Dec 2, 2025

Thanks for testing @DavideIadeluca - I've not added the migration yet, but the permission issue you identified is now resolved locally for me. Can you please confirm?

Copy link
Copy Markdown
Member

@DavideIadeluca DavideIadeluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous issue is now resolved, but now it appears like a new issue is introduced with unselecting a best answer (with permitted users):

Screen.Recording.2025-12-02.at.13.06.46.mov

Copy link
Copy Markdown
Member

@DavideIadeluca DavideIadeluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally, lgtm

@imorland imorland merged commit f3f310a into 2.x Dec 2, 2025
32 checks passed
@imorland imorland deleted the im/own-post-permission branch December 2, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants