Repair the non-share save Query option
This PR intends to fix the option to "not-share" private Queries in the Query Menu
The Option is in the Query Menu for a knowledge base. On the right side is a field to save a query with a checkbox to give the choice to share it or not. This checkbox had was ignored so far and checked or not didn't make a difference. All saved queries were saved in the same knowledge base and visible for everyone.
I expected them to be only visible for the creator (if the box was checked prior to saving).
I just fixed the errors in the existing implementation (the button was only deactivated in the extensions/queries/resources/savepartial.js) and added a proper authentication check.
Now it creates properly an extra knowledge base for the user queries if he doesn't want do share them. This doesn't seem to be supported in the extensions that work with saved queries though. Hence i would say that we should probably think how and If we want to support this feature and add support for it in the extensions, that work with saved queries as needed.
TODOs (as discussed via Skype):
- do not bypass access control check for model creation
- fix statement parameters (see for example Virtuoso store backend) for values
- activate feature in JS file
Done @pfrischmuth
@pfrischmuth isActionAllowed did return null as false in my tests. I doubt it is testet. I guess we should then add the case as well, that the user has no rights to create a knowledge base, but one for the user exists to save (created from the Admin for that purpose?).
I added a case for non-writable db's, but I don't know how to make a db unwriteable, so I couldn't test the functionality.
Tested With Non-Editable, Editable, Without AC Rights, Without AC Rights with QDB and with AC Rights
@shinobu, please update the description of this issue/pull request,
- how do I get there
- what do I experience
- what did I expect?
- how did I solve the issue