1

i have this controller
News\LatestNews\Controller\Adminhtml\News.php

and if i comment this

protected function _isAllowed()
{

   // return $this->_authorization->isAllowed('News_LatestNews::manage_news');

}

the page shows access denied, but If turn it on,

it shows this error

1 exception(s):
Exception #0 (InvalidArgumentException): Boolean value is expected, supported values: array (
  0 => true,
  1 => 1,
  2 => 'true',
  3 => '1',
  4 => false,
  5 => 0,
  6 => 'false',
  7 => '0',
)

what is the problem? how can i fix this?

newBieInMagentohere

4
  • have you add acl.xml??/ Commented Feb 17, 2017 at 9:27
  • have you tried var_dump($this->_authorization->isAllowed('News_LatestNews::manage_news')); to check the return type? Commented Feb 17, 2017 at 9:37
  • yes i already tried, and it returns true. I have acl.xml
    – enjames
    Commented Feb 17, 2017 at 9:37
  • In Admin Role u have permission for this module?
    – Jackson
    Commented Feb 17, 2017 at 9:44

2 Answers 2

1

Check for correct XML. Take a look for line breaks in values like

<element> \n true </element>

In my case it was a copy'n'paste fail :D

0

For people who came here from google - one of your config node has

 xsi:type="boolean"

But it's value is different, eg:

<item name="something" xsi:type="boolean">some_string_instead_boolean</item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.