[go: up one dir, main page]

Page MenuHomePhabricator

Convert use of $wgUrlShortenerReadOnly to urlshortener-create-url in production
Open, Needs TriagePublic

Description

Now that T228780: New user right for creation of new short URL has introduced a requirement for a user right (urlshortener-create-url) in order to create new short urls, $wgUrlShortenerReadOnly, which is currently used on wikimedia foundation wikis to restrict creation of short urls on non-meta wikis, can be deprecated in favor of the new right requirement.

  1. Remove the right from all (*) on all wikis
  2. Grant the right to * on meta wiki
  3. Remove uses of $wgUrlShortenerReadOnly

Event Timeline

Ah, I hadn't thought of that. This means there are 3 different cases

  • User has the right to create a short url, and the wiki allows it -> create
  • User has the right to create a short url, and the wiki does not allow it -> $wgUrlShortenerReadOnly, current message
  • User does not have the right to create a short url -> badaccess-groups, access denied based on lacking the rights

By removing the right from users, this will prevent the UrlShortener special page from being displayed at Special:SpecialPages, which means the current message will be viewed less. However, I'm not sure that $wgUrlShortenerReadOnly can be removed and still show a message like the current one. Maybe something like "You do not have the right to create a short url on this wiki. On wikimedia foundation wikis, short urls can only be created on metawiki"? The problem with this is that this will be shown on all wikis, including those not hosted by the wmf

Probably we can override it in WIkimediaMessages?

Probably we can override it in WIkimediaMessages?

Sure. T221526 changed the readOnly note to explain about meta - what about just using the same message content (english: "Short links can only be created via [[:m:Special:UrlShortener|Special:UrlShortener]] page on meta.wikimedia.org.") as the new message for lacking the user rights? Just changing all of the current message keys to reflect the new use would result in avoiding needing to retranslate the message.

DannyS712 changed the task status from Stalled to Open.Jun 7 2020, 2:51 AM

Next up: Remove the rights needed
Since user rights are checked before wgUrlShortenerReadOnly, users should no longer be shown the read only message

Change 645309 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[operations/mediawiki-config@master] Assign urlshortener-create-url permission

https://gerrit.wikimedia.org/r/645309

Change 645309 merged by jenkins-bot:
[operations/mediawiki-config@master] Assign urlshortener-create-url permission

https://gerrit.wikimedia.org/r/645309

Mentioned in SAL (#wikimedia-operations) [2020-12-07T12:47:16Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: ee1e40061ac4d52a90f0d44c08f1665aed83a618: Assign urlshortener-create-url permission (T229633) (duration: 01m 06s)

Change 646661 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[operations/mediawiki-config@master] Revoke urlshortener-create-url from sysops

https://gerrit.wikimedia.org/r/646661

Change 646661 merged by jenkins-bot:
[operations/mediawiki-config@master] Revoke urlshortener-create-url from sysops

https://gerrit.wikimedia.org/r/646661

Mentioned in SAL (#wikimedia-operations) [2020-12-07T12:53:02Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: 5691a397a9de05deddea94318dc6fa6c59c44833: Revoke urlshortener-create-url from sysops (T229633) (duration: 01m 06s)