Feature/issue 40 viewcomments permission - #41
Open
markuskeunecke wants to merge 2 commits into
Open
Conversation
Collaborator
|
Dear Markus, thank you for submitting a PR for this new feature. We will take it under review. |
YvarRavy
requested changes
Aug 11, 2026
| mounted() { | ||
| // Only initialize selection events in regular page mode | ||
| if (!this.store.isSpecialPageMode) { | ||
| if (!this.store.isSpecialPageMode && this.userStore.canAddComments) { |
Contributor
|
|
||
| private function doListComments() { | ||
| if ( !$this->canViewComments() ) { | ||
| $this->addError( 'smartcomments-api-list-error-no-permission' ); |
Contributor
There was a problem hiding this comment.
i've just noticed that the errors should be i18n strings but they are not. could you change this to be prefixed to sc-* just like other i18n and add it to the i18n files. i'll create a seperate mr where i fix the rest of the strings
Comment on lines
+179
to
+182
| private static function canViewComments( \User $user ): bool { | ||
| return $user->isAllowed( self::PERMISSION_VIEW_COMMENTS ) || | ||
| $user->isAllowed( self::PERMISSION_MANAGE_COMMENTS ); | ||
| } |
Contributor
There was a problem hiding this comment.
Can you make this backwards compatible? Anyone with add-inlinecomments should still be able to view comments and use Special:SmartComments like before. otherwise wikis with custom groups lose access on upgrade without any config change. So the view check should be view || add || manage
| ); | ||
| } | ||
|
|
||
| private function canViewComments(): bool { |
Contributor
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull request for #40.