?
Referenced as Pull Request for: # 10653
avatar yild
yild
26 May 2016

Steps to reproduce the issue

User/group isn't allowed to insert link to article via XTD "Article" button when we want to limit users to edit its own articles.
"Global Configuration/Permissions settings", Edit Own == Allowed, function "Article" (XTD button) rise JERROR_ALERTNOAUTHOR message.

Expected result

User/group should be allowed to add article link even with core.edit.own set to Allowed not only with core.edit.

Actual result

User/group are not allowed to add article link with core.edit.own permissions (only, core.edit set to Denied).

Additional comments

Problem is in components\com_content\content.php file

current code:

elseif ($input->get('view') === 'articles' && $input->get('layout') === 'modal')
{
    if (!$user->authorise('core.edit', 'com_content'))
    {
        JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');

        return;
    }
} 

changed code to:

elseif ($input->get('view') === 'articles' && $input->get('layout') === 'modal')
{

if (!($user->authorise('core.edit', 'com_content') ||
$user->authorise('core.edit.own', 'com_content')))
    {
        JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');

        return;
    }
}

gives wanted result - users/groups with core.edit.own permission only are allowed to insert links

avatar yild yild - open - 26 May 2016
avatar infograf768
infograf768 - comment - 26 May 2016

please make pr

avatar yild yild - change - 27 May 2016
The description was changed
avatar yild
yild - comment - 27 May 2016

I've tried but failed to do so...


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10636.

avatar brianteeman
brianteeman - comment - 27 May 2016

Just make your change to the staging branch


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10636.

avatar andrepereiradasilva
andrepereiradasilva - comment - 27 May 2016

go to https://github.com/joomla/joomla-cms/blob/staging/components/com_content/content.php and press the edit icon (pencil). make the changes, had a commit description, save and submit a PR explaining what you have done and how to test.

avatar yild
yild - comment - 28 May 2016

Thanks... done :)
#10653


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10636.

avatar brianteeman
brianteeman - comment - 28 May 2016

Thanks. Closing as we have a pull request for testing

avatar brianteeman brianteeman - change - 28 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-28 12:25:17
Closed_By brianteeman
avatar brianteeman brianteeman - close - 28 May 2016

Add a Comment

Login with GitHub to post a comment