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

  • have you add acl.xml??/ – MeenakshiSundaram R Feb 17 '17 at 9:27
  • have you tried var_dump($this->_authorization->isAllowed('News_LatestNews::manage_news')); to check the return type? – Vincent Hornikx Feb 17 '17 at 9:37
  • yes i already tried, and it returns true. I have acl.xml – enjames Feb 17 '17 at 9:37
  • In Admin Role u have permission for this module? – Ankit Shah Feb 17 '17 at 9:44
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, privacy policy and cookie policy

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