Skip to content

Commit

Permalink
Update item.php (#12825)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva authored and roland-d committed Nov 13, 2016
1 parent fa5aa78 commit 631501d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions administrator/components/com_menus/models/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,10 @@ protected function canDelete($record)
*/
protected function canEditState($record)
{
$user = JFactory::getUser();

$menuTypeId = 0;

if (!empty($record->menutype))
{
$menuTypeId = $this->getMenuTypeId($record->menutype);
}
$menuTypeId = !empty($record->menutype) ? $this->getMenuTypeId($record->menutype) : 0;
$assetKey = $menuTypeId ? 'com_menus.menu.' . (int) $menuTypeId : 'com_menus';

return $user->authorise('core.edit.state', 'com_menus.menu.' . (int) $menuTypeId);
return JFactory::getUser()->authorise('core.edit.state', $assetKey);
}

/**
Expand Down

0 comments on commit 631501d

Please sign in to comment.