Aimeos redirect backend with error
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 20
- Joined: 13 Jul 2016, 08:03
Aimeos redirect backend with error
Hello,
i'm trying to set permission to the admin in the expert mode so he cannot change or add or delete a catalog i just want to let him to add a product to a catalog so i saw the request that is sent to do action and i realized that there is different method name sent either insertItems or save items or...
i created a new permission in my backend
and in the do action i'm verifying if this admin has access to modify catalog but i can't find a way to redirect him back but i'm getting error and it's keep loading and if i remove the output and send an empty array it gave me error undefined variazble output and if i delete the array it's also giving me an error
Any recommendation?
i'm trying to set permission to the admin in the expert mode so he cannot change or add or delete a catalog i just want to let him to add a product to a catalog so i saw the request that is sent to do action and i realized that there is different method name sent either insertItems or save items or...
i created a new permission in my backend
and in the do action i'm verifying if this admin has access to modify catalog but i can't find a way to redirect him back but i'm getting error and it's keep loading and if i remove the output and send an empty array it gave me error undefined variazble output and if i delete the array it's also giving me an error
Any recommendation?
Re: Aimeos redirect backend with error
You can only return an error object for JSON RPC calls, redirects won't have any effects (it's AJAX).
If you want to allow only adding products to categories, the simple admin interface can do this as well (in the product detail view). This would be much easier.
If you want to allow only adding products to categories, the simple admin interface can do this as well (in the product detail view). This would be much easier.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 20
- Joined: 13 Jul 2016, 08:03
Re: Aimeos redirect backend with error
ok i added
throw new \Exception( 'You do not have permission to the folowing action!' );
But it's not showing as alert like other exceptions it's showing in the inspect element network
is there a method to show the exception as alert?
throw new \Exception( 'You do not have permission to the folowing action!' );
But it's not showing as alert like other exceptions it's showing in the inspect element network
is there a method to show the exception as alert?
Re: Aimeos redirect backend with error
Throwing an exception in the Laravel code doesn't transform into a JSON RPC error message. You have to build and return a JSON response yourself. Use this code as example: https://github.com/aimeos/ai-admin-exta ... c.php#L157
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
