Can't browse a BREAD that I have created. I always have this error "This action is unauthorized". However i've already added permisions for that BREAD to admin user.
Any Helps or suggest?
Thanks...
Same here. Fresh installation
can nobody help us?
not so active community hm? :-(
Hello, After you created BREAD go to Roles->admin and add permissions.
@edvinas1995 i've already added permisions for that BREAD to admin user but I have always this error this action is unauthorized.
@edvinas1995 works great at my projekt, thanks
I have the same issue, fresh install and Role for admin is set...
Symfony \ Component \ HttpKernel \ Exception \ AccessDeniedHttpException
This action is unauthorized.
Any idea to fix that?
faces this if i change model path on bread too.. tried to solve it.. but no solution yet
Thanks @SamSolomon0611 i solved my problem just by changing my model path "App models" to "App"(i have created a folder Models for all my models but now i have deleted it and moved all my models in App)
Just check name of your model. I had this error i just forger to Write the model name first letter Uppercase.
I'm having this issue and tried all the above but still no luck.
the table was created with the wrong name so i changed the table name in phpMyAdmin to match the table voyager was looking for.
i named the table 'reportData' in the create new table page
voyager was looking for 'report_data'
i had the same issue, after creating new BREAD it continues to shot "This action is unauthorized".
in BREAD my model path was App[model_name], so i chang it to App[model_name] and it start working.
Hope this can be helpful to you too.
I had the same issue, but returned true in the authorize method inside my {RequestName}Request.
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
Then it started working.
I've had the same issue as this. The issue was for me that I had the model starting with a lowercase character. When this was corrected to uppercase it resolved the issue.
having the exact same error , permissions given to admin via the Roles page but still getting Unauthorized access message
Please open a new issue
Check if the "permissions" table contains the correct table names. I changed my table name and Voyager wont automatically change it in the permissions table..
I had similar problem with AccessDeniedHttpException.
If you use custom policies(in other part of the application for example) you may need to add BREAD methods(browse, read, edit, add, delete) there.
I've created trait that do the work for me:
`trait VoyagerPolicyTrait
{
public function browse(User $user)
{
return $user->isAdmin();
}
public function edit(User $user)
{
return $user->isAdmin();
}
public function add(User $user)
{
return $user->isAdmin();
}
public function delete(User $user)
{
return $user->isAdmin();
}
public function read(User $user)
{
return $user->isAdmin();
}
}`
Policy class
class ReviewPolicy
{
use HandlesAuthorization;
use VoyagerPolicyTrait;
}
Hope it will be helpful.
@girni I faced this problem too, and I had tried almost all of the solutions above. However, only your solution successfully solve my specific situation. Thx for solving it soooo much !!!
remove /App/Product to
App/Product
remve / sign
Dashboard - Database -Products -Bread -Edit