File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed
http-tests/document-hierarchy
java/com/atomgraph/linkeddatahub/resource/acl
webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ initialize_dataset " $END_USER_BASE_URL " " $TMP_END_USER_DATASET " " $END_USER_ENDPOINT_URL "
5+ initialize_dataset " $ADMIN_BASE_URL " " $TMP_ADMIN_DATASET " " $ADMIN_ENDPOINT_URL "
6+ purge_cache " $END_USER_VARNISH_SERVICE "
7+ purge_cache " $ADMIN_VARNISH_SERVICE "
8+ purge_cache " $FRONTEND_VARNISH_SERVICE "
9+
10+ # add agent to the writers group
11+
12+ add-agent-to-group.sh \
13+ -f " $OWNER_CERT_FILE " \
14+ -p " $OWNER_CERT_PWD " \
15+ --agent " $AGENT_URI " \
16+ " ${ADMIN_BASE_URL} acl/groups/writers/"
17+
18+ # create container
19+
20+ slug=" test-children-query"
21+
22+ container=$( create-container.sh \
23+ -f " $AGENT_CERT_FILE " \
24+ -p " $AGENT_CERT_PWD " \
25+ -b " $END_USER_BASE_URL " \
26+ --title " Test Children Query" \
27+ --slug " $slug " \
28+ --parent " $END_USER_BASE_URL " )
29+
30+ # execute SPARQL query to retrieve children of the end-user base URL
31+
32+ query=" DESCRIBE * WHERE { SELECT DISTINCT ?child ?thing WHERE { GRAPH ?childGraph { { ?child <http://rdfs.org/sioc/ns#has_parent> <${END_USER_BASE_URL} >. } UNION { ?child <http://rdfs.org/sioc/ns#has_container> <${END_USER_BASE_URL} >. } ?child <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?Type. OPTIONAL { ?child <http://purl.org/dc/terms/title> ?title. } OPTIONAL { ?child <http://xmlns.com/foaf/0.1/primaryTopic> ?thing. } } } ORDER BY (?title) LIMIT 20 }"
33+
34+ curl -k -f -s \
35+ -G \
36+ -E " $AGENT_CERT_FILE " :" $AGENT_CERT_PWD " \
37+ -H ' Accept: application/n-triples' \
38+ --data-urlencode " query=$query " \
39+ " ${END_USER_BASE_URL} sparql" \
40+ | grep -q " <${container} >"
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ public Response get(@QueryParam(QUERY) Query unused,
124124 try
125125 {
126126 final ParameterizedSparqlString authPss = getACLQuery ();
127- authPss .setParams (new AuthorizationParams (getApplication ().getBase (), accessTo , agent ).get ());
127+ authPss .setParams (new AuthorizationParams (getApplication ().getAdminApplication (). getBase (), accessTo , agent ).get ());
128128 Query authQuery = new SetResultSetValues ().apply (authPss .asQuery (), docTypesResult );
129129 assert authQuery .toString ().contains ("VALUES" );
130130
Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ LIMIT 10
498498 </xsl : variable >
499499
500500 <!-- the types of this document that are not already show as $default-classes -->
501- <xsl : for-each-group select =" ($this-auth, rdf:Description[acl:accessToClass/@rdf:resource[not(. = $default-classes)] ])"
501+ <xsl : for-each-group select =" ($this-auth, rdf:Description[acl:accessToClass/@rdf:resource])"
502502 group-by =" acl:accessToClass/@rdf:resource" >
503503 <xsl : variable name =" granted-access-modes" select =" distinct-values(current-group()/acl:mode/@rdf:resource)" as =" xs:anyURI*" />
504504
You can’t perform that action at this time.
0 commit comments