RADIUSdesk/rdcore

Error When Printing Current User in CakePHP and Restricting Toolbar Access

Opened this issue · 0 comments

I'm encountering an issue in my CakePHP application when trying to print the current user. I'm using the following code:
$user = $this->Auth->user();
debug($this->Auth->user());

However, this results in a 500 Internal Server Error with the following message:

/cake4/rd_cake/permanent-users/menu-for-grid.json
500 Internal Server Error
Call to a member function user() on null

generally i want to prevent any user except root to show the toolbar where create permenant suer

It appears that $this->Auth is not properly initialized or is null, causing the user() function to fail.
how can i solve this issue