?
avatar Bakual
Bakual
20 Jan 2020

Steps to reproduce the issue

Create a user which isn't allowed to create new menuitems, but is allowed to create new articles

Expected result

The button "Save2Menu" doesn't show in the article form

Actual result

Button shows

Additional comments

I haven't tested this but stumbled over the code while writing my own extension.
Code is in

$childBar->save('article.save2menu', Text::_('JTOOLBAR_SAVE_TO_MENU'));
and
if ($canDo->get('core.create'))
{
$childBar->save('article.save2menu', Text::_('JTOOLBAR_SAVE_TO_MENU'));

If you look at it you see that the code just checks if the user is allowed to create in com_content. It should instead explicitely check against com_menus.

avatar Bakual Bakual - open - 20 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jan 2020
avatar infograf768
infograf768 - comment - 21 Jan 2020

Does it not need to be both, just for save2menu, save2copy needing only core.create ?

avatar Bakual
Bakual - comment - 21 Jan 2020

save2copy can be done with $canDo->get('core.create') as currently done.
It's just the save2menu with needs an explicit check like

if ($user->authorise('core.create', 'com_menus.menu'))
{
	$childBar->save('article.save2menu', Text::_('JTOOLBAR_SAVE_TO_MENU'));
}

I haven't had time yet to test it, but that's what I think is the correct check.

avatar Bakual
Bakual - comment - 21 Jan 2020

Closing as we have a PR: #27590

avatar Bakual Bakual - close - 21 Jan 2020
avatar Bakual Bakual - change - 21 Jan 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-01-21 20:20:23
Closed_By Bakual

Add a Comment

Login with GitHub to post a comment