matcorrao VIP
Total posts: 83
02 Dec 2014 20:54

Hello Support,

I'm writing because I've found sth weird on last Cobalt version.

On file "components\com_cobalt\library\php\helpers\access.php", the method allowHide is written as follows:

public static function allowHide($record, $type, $section)
{
    $user = JFactory::getUser();

    if($type->params->get('properties.allow_hide') && $record->user_id && ($record->user_id == $user->get('id')))
    {
        return TRUE;
    }

    return FALSE;
}

This wouldn't allow any moderator to use that feature, in other words, it's just the author the one that can set the record as hidden or not. I've checked Cobalt 7 access file and the method considered the fact that an administrator could hide any record. On Cobalt 7:

public static function allowHide($record, $type, $section)
{
    $user = JFactory::getUser();

    if(in_array($type->params->get('properties.item_can_moderate'), $user->getAuthorisedViewLevels()))
    {
        return TRUE;
    }
    if($type->params->get('properties.allow_hide') && $record->user_id && ($record->user_id == $user->get('id')))
    {
        return TRUE;
    }

    return FALSE;
}

Is this some kind of unnoticed problem or is it intentional? Personally, I believe it's quite better to let moderators hide or unhide records.

Thanks, Matias

Last Modified: 04 Dec 2014


Sergey
Total posts: 13,748
04 Dec 2014 04:32

This is intentional. This is completely private feature of the article author. If he hidden article no one, even admin have to be able to unhide it. And vice versa.

If admin whats to get rid of the article, he may unpublish it. So admin has his tool to make work done. And in this case, author of the article cannot publish it back. unlike with hidden feature. If admin hide, author may immediately unhide it.


matcorrao VIP
Total posts: 83
04 Dec 2014 23:41

Hi Sergey,

Ok, thanks for clarifying this, it's good to know. Thanks for the input, as always!

Best, Matias

Powered by Cobalt