Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Repair the non-share save Query option #392

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

shinobu
Copy link
Collaborator

@shinobu shinobu commented Aug 20, 2016

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.

@@ -714,7 +714,7 @@ private function createUserQueryDB()

//domain of this db (needed?)
$object['value'] = $this->_privateConfig->saving->baseQueryDbUri;
$object['object_type'] = Erfurt_Store::TYPE_IRI;
$object['type'] = 'iri';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to uri

@pfrischmuth
Copy link
Contributor

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

@shinobu
Copy link
Collaborator Author

shinobu commented Aug 26, 2016

Done @pfrischmuth

@@ -408,7 +408,11 @@ public function savequeryAction()
$res = "json or desc missing";
// checking for post data to save queries
$params = $this->_request->getParams();
if (isset($params['json']) && isset($params['json'])) {
$hasAC = !(
empty(Erfurt_App::getInstance()->isActionAllowed('ModelManagement'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the call to empty good for? The isActionAllowed returns a bool.

Please also consider to check whether the current model is writable, for the "share with others" case (not sure whether this is currently checked somewhere, please verify).

@shinobu
Copy link
Collaborator Author

shinobu commented Aug 30, 2016

@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
Copy link
Collaborator Author

shinobu commented Aug 31, 2016

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
Copy link
Collaborator Author

shinobu commented Sep 2, 2016

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

supported right now. This creates a db for users (with AC check) who are
allowed to creade them, the checkbox is prechecked as most user won't have
the permission to create their own dbs. Fixes Wrong Parameters and some
Typos as well.
@white-gecko
Copy link
Member

white-gecko commented Jul 11, 2017

@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 white-gecko assigned shinobu and unassigned white-gecko Jul 11, 2017
@shinobu shinobu changed the title Repair the non-share save query option Repair the non-share save Query option Jul 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants