Security Restrict not working for multiple permissions

Hi,
What is the expected behavior when setting multiple permissions under the Security Restrict component ?
Does the system authorize a user that have at least one of the permissions?
I had assumed so but it is not working as such,
Please advise
Elias

This is an old video but may help you with setting multiple permissions for users

Hi Elias,
How did you setup your multiple permissions and how do you check them?

Thank you but that was before they have allowed multiple groups under security restrict

Hi Teodor, i have set the permissions as per the wappler tutorial.

In Security restrict, if I have one permission or none, it works well

However, when I have 2 permissions neither permission 1 nor permission 2 works.

Can you please check?

@Teodor, I see what @Elias is talking about.

If you set multiple groups on the security restrict, it will throw an error, but if one group or no groups are selected, it works just fine.

More than one group selected (with error):
security%20restrict%201

Only one group selected (no error):
security%20restrict%203

I think it has do with the user and permissions in the Security Provider. It might be that we are setting up our conditions wrong on our permissions, but I might be wrong on that.

For example, I have my public setting to include all levels of permissions, where my other permissions are a combination of different settings.
security%20restrict%205

When I set the security restrict to public, I would assume that as an Administrator with a permission of β€œ2”, I would be able to see the content. However, it throws a 403 Forbidden error when I try to view it.

When I set the security restrict to administrator, I am able to see it with no error.
security%20restrict%206

After going back and re-watching @Hyperbytes video, I added the additional permissions to my user and also changed the β€˜=’ to an IN in the Security Provider and removed the additional conditions so each permission only has one condition.

So now my user has the permissions of Admin and Public as described in the video. I set the Security Restrict to the Public permission only and the content is displayed as it should be. This might help you out @Elias.

However, I now remember why I had an issue with this. Doing this broke other portions of my website, but I’ll post that in a different topic.

Thank you @scott, does it work now if you set multiple permissions under security restrict?

Yes, I have all five of my permissions on the Security Restrict for my dashboard and it its retrieving my name to display on the page.

1 Like

@Elias and @scott
If you want to add multiple IDs to a permission you should use the IN operator with a comma separated list of values in the conditions list.

1 Like