Use function limitations in my own module.

Author Message

Paul Etienney

Wednesday 10 March 2010 8:26:06 am

Hi,
I am creating my own module. I defined a function limitation (the Owner one) but i do not know how to use it in my view.
Any clue ? Any link ?
Thank you very much.
PaulHi,
I am creating my own module. I defined a function limitation (the Owner one) but i do not know how to use it in my view.
Any clue ? Any link ?
Thank you very much.
Paul

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Paul Etienney

Thursday 11 March 2010 9:32:15 am

Hi again,

I had the same discussion on linkedin in the ez Ecosystem group. (i recommand this group is lively and i had in the past good help). Here are the discussion we had.

-------------------------------------------------------------------------------------- From Felix Woldt :

hi, you have to define the function limitiation in module.php In the example at the following link it ist 'functions' => array( 'read' ), ... $FunctionList['read'] = array(); http://share.ez.no/articles/ez-publish/an-introduction-to-developing-ez-publish-extensions/(page)/4 Felix

-------------------------------------------------------------------------------------- From me :

Hi Felix, Thank you for your answer. Actually, I have already defined my functions and my function limitations in module.php. I would like to create this policy : "You can change the owner of this objects IF you are the actual owner.". Any idea ? $ViewList["ownerchange"]= array( 'functions' => array( 'ownerchange' ), 'script' => 'ownerchange.php', 'params' => array('ObjectId') ); $Assigned = array( 'name'=> 'Owner', 'values'=> array( array( 'Name' => 'Self', 'value' => '1') ) ); $FunctionList = array(); $FunctionList['ownerchange'] = array('Owner' => $Assigned);

-------------------------------------------------------------------------------------- From Felix Woldt :

i understood, the standard ez permission check implements only your_module/ownerchange you defined a subset 'Owner' This configuration you have to check by yourself in you module_view 'ownerchange'

-------------------------------------------------------------------------------------- From me :

Thank you again. This is what i am trying to do. I will do the owner id check by myslef but i do not know how to access to the current user permissions inside my own module.

-------------------------------------------------------------------------------------- From Kristof Coomans :

The current user you can retrieve with eZUser::currentUser(), Then on the returned object, you can call the method hasAccessTo(), seehttp://pubsvn.ez.no/doxygen/4.2/html/classeZUser.html#ee29e5e1065c6b68132bb6c665a8f3dbThe return value will contain a list of the applied policy function limitations, if any.

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.