Monday 12 June 2006 11:02:58 am
Hi Xavier Related topic: http://ez.no/community/forum/setup_design/fetch_limitation_parameter . But it doesn't tell you what to use inside the array ;-) You can modify eZContentObjectTreeNode::getLimitationList. Before it's last line...
return $limitationList;
...put something like this:
eZDebug::writeDebug( $limitationList );
...and now you can see the limitation list of the current user. Or if we're going a bit further we end up in eZUser::hasAccessTo:
$accessArray =& eZRole::accessArrayByUserID( array_merge( $this->groups(), array( $userID ) ) );
You will find the limitation list in $accessArray['content']['read']. It goes further in eZRole::accessArrayByUserID, which accepts an array of id's (user object id's and/or user group object id's). The problem with all these functions is that they use a caching mechanism ( in site.ini: [RoleSettings] EnableCaching ). Otherwise you could make a template operator or fetch function calling eZRole::accessArrayByUserID with whatever user group you want, and get the limitation list of that group back. A quick hack would be the modification of eZRole::accessArrayByUserID
function accessArrayByUserID( $userIDArray, $enableCaching = null )
and if $enableCaching is a boolean then don't execute
$enableCaching = $ini->variable( 'RoleSettings', 'EnableCaching' );
It would be a small hack, but what you have to accomplish will be much easier (and dynamic, in case the policies of the "member" group change). Good luck! And thanks in advance for sharing the hack & template operator / fetch function with us ;-)
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
|