Forums / Developer / Impossible to fetch Users

Impossible to fetch Users

Author Message

Pierre T.

Wednesday 14 May 2008 7:58:43 am

I want to fetch all users registered in ezpublish (all users from all user groups). Here is the tree of the user group :

Users
|_ Guest Accounts
|_ Administrator Users
|_ Editors
|_ Anonymous Users

The node <Users> has ID 5. So, according to the documentation about fetching content, I could write :

{def $nodes=fetch ( 'content', 'list', hash( 'parent_node_id', 5 ) ) }
{foreach $nodes as $node}
     {$node.name|wash}
{/foreach}

But nothing appears...

I try to change the parent_node_id by the node_id of the root node of the website and the fetch works. Why I can't fetch the node of Users ? (I have currently users in Administrator Users)

André R.

Wednesday 14 May 2008 8:28:29 am

Are you logged in as a user with read access to those nodes when you try this? ( for instance logged in as admin )

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Maxime Thomas

Sunday 18 May 2008 10:26:35 pm

Hi,

You can also add to the hash the following parameter :

'limitation', array()

It allows your fetch to override the current read rights and actually fetch the nodes you would like it to fetch.

Hope it helps.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Pierre T.

Tuesday 20 May 2008 1:31:18 am

Thanks a lot Maxime & André, It works now (read rights problem) !