01tonythomas has uploaded a new change for review.
https://gerrit.wikimedia.org/r/242846
Change subject: Check for 'newsletter-addpublisher' permission in API too
......................................................................
Check for 'newsletter-addpublisher' permission in API too
Fix minor documentation error too.
Follow up from : I00c15c5cbbb7fcfbed5593a61422560f4f854324
Change-Id: I9fb50571c6bc8b72fb2e6870dc61b0d0006aaaee
---
M includes/api/ApiNewsletterManage.php
M includes/specials/SpecialNewsletterManage.php
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter
refs/changes/46/242846/1
diff --git a/includes/api/ApiNewsletterManage.php
b/includes/api/ApiNewsletterManage.php
index 5fc8d90..67cf8cc 100644
--- a/includes/api/ApiNewsletterManage.php
+++ b/includes/api/ApiNewsletterManage.php
@@ -15,6 +15,10 @@
$this->dieUsage( 'You must be logged-in to interact
with newsletters', 'notloggedin' );
}
+ if ( !$user->isAllowed( 'newsletter-addpublisher' ) ) {
+ $this->dieUsage( 'You do not have the necessary rights
to interact with the newsletter', 'notnewsletteradmin' );
+ }
+
//TODO should probably do something here depending on the
result..
if ( $this->getMain()->getVal( 'todo' ) === 'removepublisher' )
{
$db = NewsletterDb::newFromGlobalState();
diff --git a/includes/specials/SpecialNewsletterManage.php
b/includes/specials/SpecialNewsletterManage.php
index beca03d..8c46460 100644
--- a/includes/specials/SpecialNewsletterManage.php
+++ b/includes/specials/SpecialNewsletterManage.php
@@ -35,7 +35,7 @@
$announceIssueForm->show();
if ( $this->getUser()->isAllowed(
'newsletter-addpublisher' ) ) {
- // The user does not have required permissions
+ // The user have required permissions
$addPublisherForm = new HTMLForm(
$this->getPublisherFormFields(),
$this->getContext(),
--
To view, visit https://gerrit.wikimedia.org/r/242846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fb50571c6bc8b72fb2e6870dc61b0d0006aaaee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits