Is it true that "User" role can't use Smart Action?

We’re suffering the issue that account has “User” role can’t use or even see Smart Action. It took us several days to investigate this problem because we can’t find useful document mention about “User” role abilities except for this vague one https://docs.forestadmin.com/documentation/reference-guide/teams-and-users/manage-roles.

So please help us if we have any solution that “User” role can see and use Smart Action? Thanks


Update:

I want to add more information that I just discovered. We have 2 different Smart Action types:

  1. One is single and “User” role account can use this action
  2. Another is global and “User” role account CANNOT use this action.
1 Like

Hi @mr.leo,

I actually tried global & single actions on a newly created lumber project, and I’m not able to reproduce your issue. Smart actions (By default) should be accessible for users, and could be specified to restrict access using your collection settings (under the Smart Actions tabs).

In order to help you with this, could you provide me the route,the forest part of the file declaring the smart actions and the version of forest-express-sequelize/mongoose you are using ?

Sure, my bad, I had to attach my current version in the beginning. Here the information:

Context

  • Package Version: forest-express-sequelize 5.7.0
  • Express Version: 4.17.1
  • Sequelize Version: 5.15.2
  • Database Dialect: Postgres (pg) 6.1.0
  • Project Name: scratchpay-payment-service

Ok. By any chances, do you have the smart actions code ?

A potential issue I see would be that you are using permissionMiddlewareCreator.smartAction() without any permissions attached in the Smart Actions section, could you try disabling this middleware and check if that works on your side ?

Thanks, it could be useful information. But can you help to elaborate which file or which service I should disable the middleware? And how to disable middleware? I’m confusing.

The file should be located in your routes directory. Without a stacktrace I cannot point you to the right file though, but depending on the collection you are trying to run the smart action on it should be pretty easy to locate.

Disabling the middleware means just to remove the permissionMiddlewareCreator.smartAction() call if present, just as a quick test to show if the issue come from this or not. If it’s not present, then the issue does not come from that part.

Hope that helps

I’m afraid to tell that I don’t have any permissionMiddlewareCreator.smartAction in my codebase.

Well, still not able to reproduce on my end … :frowning_face:

I’ve got a few ideas to help you with this:

  • If that’s possible on your side, you could try following the update to v6 documentation. A few things have been released related to smart actions (Even if I don’t think any is related to your specific issue)
  • Make sure that you don’t have anything in the “Smart Actions” tab in the collection settings that could conflict with having this smart actions displayed
  • Share here the smart actions definitions so I can reproduce the issue on my end

Also, did you try changing the smart action that is visible from single to global ?
Still trying to find a way to reproduce your issue, so don’t hesitate to give as much details as possible so I can reproduce on my side :slight_smile:

Thanks :pray:

If that’s possible on your side, you could try following the update to v6 documentation. A few things have been released related to smart actions (Even if I don’t think any is related to your specific issue)

Did you try with my forest-express-sequelize version 5.7.0? If you didn’t reproduce with this old version, it means that the version isn’t the root cause, right?

I don’t mind to share with you. But this is a public thread so I don’t want to leak anything here. I sent an email to Philippe and Louis already, it would be nice if I can add you in that email as well so I can share the codebase.

Thanks

Ah, one thing I can share here as the public thread, it’s the line where the error appears:

Hello @mr.leo :wave:

As already discussed, to fix this issue, please ensure the smart action is marked as ‘visible’, and that it is not restricted to some users.

Cheers,

Steve.

1 Like