Skip to content

Commit

Permalink
[4] Allow banner creation if there are not categories (#33399)
Browse files Browse the repository at this point in the history
* add ACL check

* allow adding banners from empty state if no categories
  • Loading branch information
Phil E. Taylor committed Apr 30, 2021
1 parent aedf7e3 commit 3a9ebcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -149,7 +149,7 @@ protected function addToolbar(): void

ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_BANNERS'), 'bookmark banners');

if (\count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)
if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)
{
$toolbar->addNew('banner.add');
}
Expand Down
Expand Up @@ -19,7 +19,9 @@
'icon' => 'icon-bookmark banners',
];

if (count(Factory::getApplication()->getIdentity()->getAuthorisedCategories('com_banners', 'core.create')) > 0)
$user = Factory::getApplication()->getIdentity();

if ($user->authorise('core.create', 'com_banners') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)
{
$displayData['createURL'] = 'index.php?option=com_banners&task=banner.add';
}
Expand Down

0 comments on commit 3a9ebcb

Please sign in to comment.