Checking authorized roles

Hi,

I have a user_roles field in my collection entries, filled with roles (as array/relationship) authorized to see this page.

In Antler, I would like to check if the logged user match any of the roles authorized.

I've googled like never before and tried any antler syntax, but without success.

One of the thousand experiments is something like this:

 {{ user }}
    {{if (authorized)}}
        {{ user:is roles=authorized }} // tried (authorized | in_array:roles) and so on
              ...
        {{ /user:is }}
    {{/if}}
  {{ /user }} 

Any help from some wiser developer out there?

>>>>>>> Unanswered <<<<<<<
4 Replies
4 Followers