Hello
As far as I know, if you have granted reader permission to all users everyone
should be able to view the same navigation tree as the manager does.
When a navigation tree is generated there are two fases that filter its nodes.
(See getNavigationItems.py)
Firstly, CPSNavigation only retrieves those nodes that the current user can
read.
Secondly getNavigationItems.py, filters the nodes returned by CPSNavigation to
remove: hidden folders, non prefixed folders, etc. depending on the
restrictions you gave when portlet was created.
To rule out the possibility that CPSNavigation is not able to show nodes to all
users. Create a new python script in portal_skins->custom with the next code
and tinker a little bit with it. Try to modify current_uid to simulate a
"click" of the user in a folder, what should show the subfolders of that
folder.
E.g. If current_uid is 'sections/jgv' you should see all parents of "jgv", its
brothers and its children (unless expand_all it's true).
The code is:
###############################
from Products.CPSNavigation.CPSNavigation import CPSNavigation
root_uid='sections' ## Identifier of the cache tree
current_uid='sections/jgv' ## Simulates the node currently active (the last
where the user clicked)
authorized_only = False
expand_all = False
object = context.portal_url.getPortalObject().sections
try:
nav = CPSNavigation(current_uid=current_uid,
no_leaves=1,
context = object,
root_uid=root_uid,
expand_all=expand_all,
authorized_only=authorized_only)
except KeyError:
nav = None
print nav
print nav.dumpTree(), len(nav.dumpTree())
print nav.getTree(), len(nav.getTree())
print nav.getListing(), len(nav.getListing())
print "--------------------------------"
for node in nav.getTree():
print "Node: ", node
print "Nodes: ", len(nav.getTree())
return printed
###############################
Test it for diferent users with
http://yourhost:yourport/cps/showMyNavigationTest where showMyNavigationTest is
the name of the script.
If for non manager users you don't get nodes, then it's a problem of
permissions.
If for non manager users you get all nodes correctly, then it's
getNavigationItems.py that it's filtering the tree, in which case you should
check the configuration of the portlet and debug the script
getNavigationItems.py. To debug, you can try to include "raise" statement in
some lines of the script and observe some variables.
If none of these gave you the solution, it means I have to learn more and I
hope somebody give us a better idea of how this works :-)
Don't hesitate to ask :-)
Regards
JoseLuis de la Rosa Triviño
Becario Área de Sistemas de Información
FUNDACIÓN IAVANTE
[EMAIL PROTECTED]
Tel. 951 015 300
Este correo electrónico y, en su caso, cualquier fichero anexo, contiene
información confidencial exclusivamente dirigida a su(s) destinatario(s). Toda
copia o divulgación deberá ser autorizada por IAVANTE.
This e-mail and any attachments are confidential and exclusively directed to
its adressee(s). Any copy or distribution will have to be authorized by IAVANTE.
-----Mensaje original-----
De: Joachim Schmitz [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 15 de marzo de 2006 17:02
Para: [email protected]
Asunto: Re: [CPS-devel] documentation of navigation portlets
Hello JoseLuis,
thanks a lot for the detailed explanation.
JoseLuis de la Rosa Triviño schrieb:
> Hello,
<snipp>
> 3. The scripts "get*Items.py" (see above) get the tree with CPSNavigation and
> after, they filter every node that doesn't satisfies the rules.
>
> On the other hand, If you want to show documents in a navigation portlet that
> is based on "getNavigationItems" script e.g. "navigation_tree": >From ZMI go
> to portal_trees, create a new tree which can be a copy of sections tree or
> workspaces tree. Now go to the properties of the new tree and in the property
> "Portal Types" add the content type identifiers e.g. "News Item".
> Then go to the "Tree" tab and click "Rebuild Tree", your navigation portlets
> will show this kind of documents too.
>
I did this and now as CPS Manager get the menu nearly as I want. But
when view it as anonymous user, I get not menu at all.
I set the local roles for /sections/jgv for all users to "Section
Reader" and the visibility of the templet to all users.
How could I debug this ?
--
Mit freundlichen Grüßen Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel