Hello Seblod users and members,
I try to get bool/false answer for the logged in user for right to edit special item(s) from CCK / article.
Could someone lean me a hand how to get it worked? I do not understand, how the CCKAccess()->check() function can be used used (from /libraries/cck/joomla/access/access.php)
/**
* Method to check if a user is authorised to perform an action, optionally on an asset.
*
* @param integer $userId Id of the user for which to check authorisation.
* @param string $action The name of the action to authorise.
* @param mixed $asset Integer asset id or the name of the asset as a string. Defaults to the global asset node.
*
* @return boolean True if authorised.
*
* @since 11.1
*/
public static function check($userId, $action, $asset = null)
//end from lib
//my last try for today :-)
$userId = JFactory::getUser()->id;
$test2 = new CCKAccess();
$test3 = $test2->check($userId, 'core.edit','83');
var_dump($test3);
//output is always NULL
I tried some stuff without success. How could I retrieve the assetid and should action be 'edit', 'core.edit' or sth else? Or do I maybe chose the totally wrong function to get the edit state for a particular article he is watching?
Or could anyone provide an example based on one article?
Thank you,
Pierre.