feat: implement permission change for selecting own post#124
feat: implement permission change for selecting own post#124BHZoon wants to merge 12 commits intoFriendsOfFlarum:1.xfrom
Conversation
DavideIadeluca
left a comment
There was a problem hiding this comment.
Appears like some changes in frontend logic are required to prevent showing the Select as Best Answer controls when not permitted to do so (in the following screencap the permission was set to admins only)
Screen.Recording.2025-12-03.at.14.38.36.mov
Besides that, there are some CI issues which need to be resolved in the frontend and backend. StyleCI doesn't automatically apply patches in Forks so you need to manually patch up the Code Style. The frontend contains both also some formatting issues (which can be fixed with yarn format) and also a typing error.
Besides all of this, this PR generally works and achieves the desired functionality. 👍
What I'm generally a little bit concerned is backwards compatibility: technically some changes warrant a MAJOR release as it contains breaking changes on paper (removal of DiscussionAttributes) class, removal of attributes in the frontend/backend). Practically, I'm not aware of anybody who would be affected by those changes here.. Maybe @imorland has opinions on this
There was a problem hiding this comment.
It's discouraged to commit dist files, this is automatically taken care of by CI. See https://docs.flarum.org/contributing/#setting-up-a-local-codebase
| }, | ||
| "dependencies": { | ||
| "yarn": "^1.22.22" |
There was a problem hiding this comment.
This is unexpected and shouldn't be added to the package.json
There was a problem hiding this comment.
the package-lock.json is unnecessary as we use yarn's yarn.lock for version locking
|
Closing this in favor of #127 |
Fixes #0000
Changes proposed in this pull request:
Changing the way, the ability to select an own post as a best answer, is handled.
It was based on a setting and set for all users.
Change implementation to a permission check.
Also moved attribute away from the Discussion and into the Post
Confirmed
composer test).Required changes: