OntoWiki icon indicating copy to clipboard operation
OntoWiki copied to clipboard

Repair the non-share save Query option

Open shinobu opened this issue 9 years ago • 6 comments

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.

shinobu avatar Aug 20 '16 18:08 shinobu

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

pfrischmuth avatar Aug 26 '16 11:08 pfrischmuth

Done @pfrischmuth

shinobu avatar Aug 26 '16 18:08 shinobu

@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?).

shinobu avatar Aug 30 '16 09:08 shinobu

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.

shinobu avatar Aug 31 '16 14:08 shinobu

Tested With Non-Editable, Editable, Without AC Rights, Without AC Rights with QDB and with AC Rights

shinobu avatar Sep 02 '16 16:09 shinobu

@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

white-gecko avatar Jul 11 '17 09:07 white-gecko