-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Apply rules upon item creation via other tools like QuickStatements #23
Comments
I do not see a reason why the rules would not be applied on edits via QuickStatements. The rules get applied on a pretty deep level in the code. The only thing that might bypass those rules is doing an XML import into the wiki. Tools like QuickStatements use the web API, and should be hitting the Wikibase hooks that we use. TL;DR: this looks invalid to me, could you double-check? Perhaps there is another reason why a rule is not being applied. |
Relevant bit of code: https://github.com/ProfessionalWiki/AutomatedValues/blob/master/src/Hooks.php#L18-L33 |
The use case I have is: A user that is not allowed to edit labels can not use the CSV import functionality of QS, they get the error that creating labels is not allowed. However when they create the item without the label, automated value only kicks in after a secondary edit of the item. |
So this user is allowed to create items but not allowed to edit item labels? That would explain why the labels are not changed. Automated Values "intercepts" the edit and adds labels to it. MediaWiki then rejects that part of the edit. At least, that is my guess of what is happening. Slightly surprising that the labels are being dropped silently; I'd have expected the whole edit to be rejected. What can we do about this? No obvious solution immediately comes to mind. We could work around the permission checks, but not in a selective manner, so this would basically break the permission system and allow people to do things they should not be able to do. |
Being able to create items without being able to edit their labels is a bit weird :) |
Well that is why we use Automated Values to stop 'regular editors' from changing the labels of an item. |
Dumping some thoughts: Possible approach A:
Possible approach B:
|
Approach A does not appear to be possible. At least not without significant changes to how the extension hooks into MediaWiki, and even then, it might not be possible. Approach B comes with a good amount of downsides. @mzeinstra why not simply grant these users the ability to edit labels? If you have rules for the labels anyway, the labels will always follow those rules. |
Providing permissions to edit labels might likely confuse the user and provide interactions that they do expect. For example, they see a label that they disagree with and they change it. However the change is immediately reversed, since automated values overrides the labels upon safe. The user might see this as a bug, and not a feature :) We wanted remove that edit functionality for most users, since they would need to change the underlying claims in order to change the label. |
In that case, the simplest solution is not to restrict label editing for these users but to hide the editing UI elements. We already talked about such an approach and it is tracked by #5 |
Currently Automated Values does not run when you create an item via quickstatements, meaning that you have to create and item with all it statements, and than touch the item again (e.g. by making a change or adding a statement) before automated values kicks in.
The text was updated successfully, but these errors were encountered: