[opencms-dev] Access right trouble in component template

Sébastien Bianco s.bianco at eurelis.com
Wed Mar 3 12:01:47 CET 2010


Hello,

 

I've got a strange behaviour in template with document with private rights. In one case, with my first template, I can see the document, not in the second case :-(

 

Here is the context:

 

I design two data structures (xml-content) - juridic and study - both having a link to VFS file (Document) (cf attached file containing the xml content description)

 

I created instances of theses objects, with Document pointing to a same file (private for guest <=> Deny view for guest set on folder containing this file)

 

Here are the template I wrote for both object:

 

juridics

 

<%@ page session="true" import="java.util.*, java.text.*,org.opencms.db.*,java.util.regex.*,org.opencms.util.*, org.opencms.util.*,org.opencms.i18n.*"%>

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %> 

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="eurelis" uri="http://www.eurelis.com/taglib/opencms/commons" %> 

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%-- ## Get if the user is connected or not ## --%>

<jsp:useBean id="cms" class="com.eurelis.opencms.commons.frontend.CmsCommonsBean">

            <% cms.init(pageContext, request, response); %>

</jsp:useBean>

 

 

<c:if test="${empty param.uri_object}">

            <c:set var="the_object">${cms:vfs(pageContext).requestContext.uri}</c:set>

</c:if>

<c:if test="${!empty param.uri_object}">

            <c:set var="the_object">${param.uri_object}</c:set>

</c:if>

 

 

 

<c:set var="locale">${cms:vfs(pageContext).propertySearch[the_object]['locale']}</c:set>

<c:if test="${empty locale}"><c:set var="locale">en</c:set></c:if>

            

 

<c:set var="editablemode">

            <c:if test="${!empty param.editablemode}">${param.editablemode}</c:if>

            <c:if test="${empty param.editablemode}">true</c:if>

</c:set>

 

 

<cms:contentload collector="singleFile" param="${the_object}" editable="${editablemode}">

            <cms:contentaccess var="xmlRsc" />

            

            

                        <%-- ## Get the document to download ## --%>

                        Document : ${xmlRsc.value['Document']}

            

</cms:contentload>

 

 

study

 

 

<%@ page session="true" import="java.util.*, java.text.*,org.opencms.db.*,java.util.regex.*,org.opencms.util.*, org.opencms.util.*,org.opencms.i18n.*"%>

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %> 

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="eurelis" uri="http://www.eurelis.com/taglib/opencms/commons" %> 

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<jsp:useBean id="cms" class="com.eurelis.opencms.commons.frontend.CmsCommonsBean">

            <% cms.init(pageContext, request, response); %>

</jsp:useBean>

 

<c:if test="${empty param.uri_object}">

            <c:set var="the_object">${cms:vfs(pageContext).requestContext.uri}</c:set>

</c:if>

<c:if test="${!empty param.uri_object}">

            <c:set var="the_object">${param.uri_object}</c:set>

</c:if>

 

 

<c:set var="locale">${cms:vfs(pageContext).propertySearch[the_object]['locale']}</c:set>

<c:if test="${empty locale}"><c:set var="locale">en</c:set></c:if>

            

 

<c:set var="editablemode">

            <c:if test="${!empty param.editablemode}">${param.editablemode}</c:if>

            <c:if test="${empty param.editablemode}">true</c:if>

</c:set>

 

<cms:contentload collector="singleFile" param="${the_object}" editable="${editablemode}">

            <cms:contentaccess var="xmlRsc" />

            

            

             Document :      ${xmlRsc.value['Document']}

</cms:contentload>

 

 

Here are the result I got when seeing the document as a guest :

 

juridics

 

Document : /fr/_data/etude_marketing/documents_complets/CP_DubaI_Oct2009.pdf

 

study

 

Document :

 

 

The behaviour seams correct for study: the user cannot see the document, so OpenCms filter the link to the document

 

 

Does anybody understand why there is such a difference in behaviour although I linked the same file (so with the same access rights!)

 

NB : I've no problem with document without any access restriction.

 

Thanks for any kind of help !

 

 

Sébastien BIANCO

Ingénieur développement

 

EURELIS

 AGITATEUR DE TECHNOLOGIES

Tel : +33 (0)1 49 97 20 20

Fax : +33 (0)1 47 68 20 19

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100303/7720038e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: juridic_ffc.xsd
Type: application/octet-stream
Size: 1467 bytes
Desc: juridic_ffc.xsd
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100303/7720038e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: study_ffc.xsd
Type: application/octet-stream
Size: 2131 bytes
Desc: study_ffc.xsd
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100303/7720038e/attachment-0001.obj>


More information about the opencms-dev mailing list