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

**URL:** <https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517>\
**Category:** Help me!\
**Created:** [June 24, 2020, 2:59am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517 "2020-06-24T02:59:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 2:59am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/1 "2020-06-24T02:59:22Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [June 24, 2020, 8:38am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/2 "2020-06-24T08:38:08Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 8:54am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/3 "2020-06-24T08:54:51Z")

</div>

> [@anon39848301](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [June 24, 2020, 10:05am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/4 "2020-06-24T10:05:33Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 10:41am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/5 "2020-06-24T10:41:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [June 24, 2020, 11:53am UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/6 "2020-06-24T11:53:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 12:38pm UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/7 "2020-06-24T12:38:50Z")

</div>

> [@anon39848301](#):
>
> Disabling the middleware means just to remove the `permissionMiddlewareCreator.smartAction()` call if present

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

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [June 24, 2020, 1:35pm UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/8 "2020-06-24T13:35:34Z")

</div>

Well, still not able to reproduce on my end … ☹

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](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-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 🙂

Thanks 🙏

---

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 1:51pm UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/9 "2020-06-24T13:51:47Z")

</div>

> If that’s possible on your side, you could try following the [update to v6](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-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?

> [@anon39848301](#):
>
> Share here the smart actions definitions so I can reproduce the issue on my end

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

---

<div class="post-metadata">

**Author:** ![mr.leo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mr.leo/32/68_2.png) [@mr.leo](https://community.forestadmin.com/u/mr.leo)\
**Post date:** [June 24, 2020, 1:53pm UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/10 "2020-06-24T13:53:09Z")

</div>

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

 ![Screen Shot 2020-06-24 at 20.22.17](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/9914f47d3871a0080010a0975d46340bb35c715d.png)

---

<div class="post-metadata">

**Author:** ![anon36130554](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@anon36130554](https://community.forestadmin.com/u/anon36130554)\
**Post date:** [June 25, 2020, 12:40pm UTC](https://community.forestadmin.com/t/is-it-true-that-user-role-cant-use-smart-action/517/11 "2020-06-25T12:40:21Z")

</div>

Hello @mr.leo 👋

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.
