Using the IN operator to filter user roles in security provide and component level role restriction

By special request of @Buggy i deal with the Security provider approach of using the IN operator to detect role allocations.
We then go on to firstly add a security restrict to a layout to prevent access from non authorised users then we retrieve a list of roles allocated to the current user via an API call on the layout page and use them to hide/show regions by use of conditional regions.

VERSION 2 DUE TO SOME MAJOR ERRORS IN VERSION 1

8 Likes

Great video! It’s addressed security based on role better than I was mapping out, saving me and others loads of time.

Kumi, Aston, and the family were surprised when they heard their names in the example. Aston even got into the character of sibling rivalry, asking why he was the photographer, not the sculptor.

Thanks for this and all the other great videos. We were having fun learning how to use Wappler.

1 Like

New video now linked in post

1 Like

Part 2
In this video we deal with the situation where the user uses the two table approach to role allocation which can return multiple roles simultaneously as a array of objects.
As the .contains() operator will not work in these circumstances we explore the .inArray() operator as a solution.

1 Like