-
Notifications
You must be signed in to change notification settings - Fork 18
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
Handle Permissions on Properties correctly when searching #182
Comments
I've been trying to implement this, and I'm not sure it's feasible with our current design. There are two problems: Counting resultsFirst, we'd have to return the IRI, owner, project, and permissions on each matching value of each matching resource. But that means we'd get one row per matching value, and our whole design is based on the requirement that we get only one row per matching resource, so we can count the number of matching resources. For example, this is this query for
There are 18 matching resources, but it returns 24 results, because there are some resources with multiple values that match. Poor performanceSecond, there seems to be a huge impact on performance. For example, the test
I don't know what we should do about this. |
To deal with the counting problem, we could eliminate the COUNT queries altogether, and do the paging entirely in Scala. This would mean getting all the results each time a page is requested. Eliminating the COUNT query would also improve performance a lot. We could also improve performance by automatically granting everyone view permission on all links, as long as you have permission to see the source and target resources. In the example above with We could also drastically limit the maximum number of results, e.g. to 100. |
Also, in the specific case where you're searching for a link to a particular resource using EQUALS, it would be much more efficient to do a separate query to get the permissions on that resource, rather than having them repeated in each row of the search results. |
I'm going to try this approach:
|
Great, sounds good. |
This seems to work OK. In |
At the moment, permissions are only checked on resources when searching.
However, when displaying a resources some of its properties may not be visible due to restrictions.
Example: Do a simple search for
Berthold
or an extended search for a book havingBerthold
as its creator. In the result,Berthold
shows up as a creator but when you open the book, thecreator
property is not visible (only when you log in).Permission checking on resources has to be added in the following SPARQL templates:
searchFulltext.scala.txt
searchExtended.scala.txt
getResourceSearchResult.scala.txt
The text was updated successfully, but these errors were encountered: