-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: implement permission change for selecting own post #124
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
base: 1.x
Are you sure you want to change the base?
feat: implement permission change for selecting own post #124
Conversation
DavideIadeluca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
js/package.json
Outdated
| }, | ||
| "dependencies": { | ||
| "yarn": "^1.22.22" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unexpected and shouldn't be added to the package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package-lock.json is unnecessary as we use yarn's yarn.lock for version locking
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: