Unauthorized Smart Action

Feature(s) impacted

Smart action

Observed behavior

I got an 403 HTTP error

Expected behavior

I should be able to do action

Context

  • Project name: MVMS-API-Stats
  • Team name: Opérations
  • Environment name: Validation
  • Agent (forest package) name & version: Rails Forest-liana 7.8.1
  • Database type: PostgreSQL
  • Recent changes made on your end if any: We made a new smart action, we deployed it on our development and staging environment, all is ok, we deployed on our validation environnement, we have this error described but all permissions settings are identical.

Hello @Loic_Boussiquet ,

Welcome to the forest community :raised_hands:,

Can you please give us your route statement, your controller and your smart action? This will help us to solve your problem :pray:.

Kind regards,

Florian

Hello @Florian_Gonzales

Yes ! The route is “POST /forest/actions/add-products-to-category”,the controller is “Forest::Actions::ProductsController” and the smart action calls “Ajouter des produits à une categorie”.

Hope this can help you !

Cheers

Can you screen the content of these files please :grin:. And if you can add a screen of the log of the error it would be perfect :ok_hand:

Kind regards,

Florian



You have here the action definition code, the controller and the server log and my bad the controller is not “Forest::Actions::ProductsController” but “Forest::Actions::CategoriesController”

Cheers

Hi @Loic_Boussiquet,

Could you share with me the content of BaseController file ?

I assume that the BaseController extend ForestLiana::SmartActionsController ?

Is the route declared before the mount ForestLiana::Engine ?

If you consider the files private, you can share it with me in a PM.

Hi @nicolasa

This the BaseController

And yes, the route is declared before ForestLiana::Engine :slight_smile:

Hope this can help you !

Cheers !

I am not able to reproduce the problem on my end.

Which role has the right to trigger this action ?

It might be a cache issue, can you run the following command on your validation environement: rails tmp:cache:clear

1 Like

I cannot explain why but it works now but we did nothing to try to resolve the issue. We have luck this time I guess haha !

Thank you for your time !

Cheers

1 Like