User permissions OR condition

Please implement OR in the conditions. Otherwise it’s impossible to give AccessLevel == 5 OR AccessLevel == 7 access to pages. Only AccessLevel >= 5. Therefore we can’t exclude AccessLevel == 6.

Currently we have to add the "or " manually like this:

 {
            "column": "ALID",
            "bool": "or",
            "operator": ">=",
            "value": "7"
          }

For ages I thought that putting access levels in the Permissions field in Security Restrict would be using OR for this. I was putting in ‘Admin’ and ‘Staff’ so that either of those users could access the page but I later realised it’s AND so I had to restructure all my permissions. However, having the option of OR would be really useful. Or a combo of the two even better, like the way the Query Builder works.

2 Likes

You need to use a two table approach to do that.
Old post but the technique is the same.

Yep, that’s what I ended up doing. But being able to simply list all the levels which have access would make it sooooo much easier.

If I had, for example, ‘superadmin’, ‘admin’, ‘staff’, ‘customer’, ‘supplier’ then I could have pages which allowed access for ‘superadmin’ and ‘admin’, another page allowing ‘superadmin’ and ‘customer’, and another allowing ‘superadmin’ and ‘supplier’. It would be easy using the existing multi-select but set it to OR instead of AND.

The logic is well explained by patrick in this post

Thanks Brian. That’s what gave me the insight into it not using OR but using AND so I have used the ‘in’ method in the users list to check if they are in any of the groups but this isn’t an ideal solution as you have to create loads of groups with all the different combinations of access levels. Having the OR option would make it very easy.