| JJMC89 added a comment. |
In T187635#4000853, @Xqt wrote:See also T78152
I guess this is a duplicate of that.
In T187635#4000936, @Xqt wrote:In T187635#3981304, @JJMC89 wrote:Can this be handled gracefully in Pywikibot?
Sure. What would be a gracefull response?
When attempting to access data from a log event the API response data should be checked for keys that indicate the data is hidden/suppressed. If the relevant key (see below) is present and the user doesn't have the rights to view it (it will not be in the response), raise an exception like UserRightsError.
From mw:API:Logevents#Results:
- actionhidden: Boolean indicating the title was hidden. ns and title will be absent if the user has no sufficient rights to view deleted log entries.
- commenthidden: Boolean indicating the comment was hidden. comment will be absent if the user has no sufficient rights to view deleted log entries.
- userhidden: Boolean indicating the user was hidden. user and userid will be absent if the user has no sufficient rights to view deleted log entries.
- suppressed: Boolean indicating details were supressed. Only users with the suppressrevision can view them.
actionhidden also hides params.
This would also apply to trying to get hidden/suppressed data about a revision.
- texthidden: Boolean indicating the text was hidden.
- userhidden: Boolean indicating the user was hidden. user and userid will be absent if the user has no sufficient rights to view deleted log entries.
- commenthidden: Boolean indicating the comment was hidden. comment will be absent if the user has no sufficient rights to view deleted log entries.
- suppressed: Boolean indicating details were supressed. Only users with the suppressrevision can view them.
TASK DETAIL
EMAIL PREFERENCES
To: JJMC89
Cc: Xqt, Framawiki, zhuyifei1999, Aklapper, pywikibot-bugs-list, JJMC89, Magul, Tbscho, rafidaslam, MayS, Mdupont, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
Cc: Xqt, Framawiki, zhuyifei1999, Aklapper, pywikibot-bugs-list, JJMC89, Magul, Tbscho, rafidaslam, MayS, Mdupont, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
