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
[BUG] 关于页面保护级别的故障/The bug is about the page protection #26
Comments
记录典型result用于debug 禁止移动{
"batchcomplete": "",
"query": {
"pages": {
"185503": {
"pageid": 185503,
"ns": 12,
"title": "Help:沙盒",
"revisions": [
{
"revid": 3626690,
"parentid": 3625988,
"user": "九江月",
"timestamp": "2020-04-16T14:32:45Z",
"comment": "/* 請在這行文字底下進行您的測試 */"
}
],
"contentmodel": "wikitext",
"pagelanguage": "zh",
"pagelanguagehtmlcode": "zh",
"pagelanguagedir": "ltr",
"touched": "2020-04-16T14:32:45Z",
"lastrevid": 3626690,
"length": 140,
"protection": [
{
"type": "move",
"level": "sysop",
"expiry": "infinity"
}
],
"restrictiontypes": [
"edit",
"move"
]
}
}
}
} 禁止移动且禁止编辑{
"batchcomplete": "",
"query": {
"pages": {
"129": {
"pageid": 129,
"ns": 0,
"title": "受限制页面",
"revisions": [
{
"revid": 1699,
"parentid": 1697,
"user": "机智的小鱼君",
"timestamp": "2019-12-05T07:49:02Z",
"comment": "[InPageEdit] 没有编辑摘要"
}
],
"contentmodel": "wikitext",
"pagelanguage": "en",
"pagelanguagehtmlcode": "en",
"pagelanguagedir": "ltr",
"touched": "2019-12-05T07:49:02Z",
"lastrevid": 1699,
"length": 6,
"protection": [
{
"type": "edit",
"level": "sysop",
"expiry": "infinity"
},
{
"type": "move",
"level": "sysop",
"expiry": "infinity"
}
],
"restrictiontypes": [
"edit",
"move"
]
}
}
}
} |
dragon-fish
added a commit
that referenced
this issue
Apr 16, 2020
* 移动logo到src文件夹 * 测试新的更新日志格式 * 测试新的关于页面 * 修复 #26
dragon-fish
added a commit
that referenced
this issue
Apr 17, 2020
* 2020年4月17日02:45:05 * 移动logo到src文件夹 * 测试新的更新日志格式 * 测试新的关于页面 * 修复 #26 * Update versionInfo * Update CSS Co-authored-by: 机智的小鱼君 <dragon-fish@qq.com>
Merged
dragon-fish
added
level-1
Push a hotfix now!
Reopened
and removed
Review
Action has been taken and the result is awaited
labels
Apr 23, 2020
Merged
Merged
Fixed, waiting for review https://github.com/Dragon-Fish/InPageEdit-v2/pull/48/files#diff-9a9569e9d73f33740eada95275da7f30R728 |
dragon-fish
removed
Reopened
Review
Action has been taken and the result is awaited
labels
May 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
简述此故障/Describe the bug
部分页面仅“移动保护”(即不允许移动),但使用快速编辑会提示“无编辑权限”。
如何重现此故障/To Reproduce
在萌娘百科的公开沙盒上,使用非管理员的账号进行快速编辑。
你的设备信息/Your device info
PC端/Desktop
Chrome.
补充说明/Additional context
问题出在
script.js
的第431行。此处直接取的protection
的第0个。但如上述例子中,页面仅对“移动”(move
)有保护,而对编辑(edit
)未保护,取第0个protection
即为移动保护。应修改成查找protection[i].type === edit
,再读取其protection[i].level
。通常页面的
protection
:"protection": [],
全保护页面的
protection
:"protection": [{"type": "edit", "level": "sysop", "expiry": "infinity"}, {"type": "move", "level": "sysop", "expiry": "infinity"}],
仅移动保护页面的
protection
:"protection": [{"type": "move", "level": "sysop", "expiry": "infinity"}],
The text was updated successfully, but these errors were encountered: