mercredi 6 mai 2020

thymeleaf syntax for authorize function

I want to use sec:authorize for specific division but i can not find the proper syntax

i am using the next

sec:authorize="hasAuthority('theAuthority')"

The Authority should change automatically and it is created by three parts where the middle is the dynamic. So example of authority is :

  1. part1 is static : text1|
  2. part2 is dynamic: ${object}
  3. part3 is static: |text3

So i have tried:

sec:authorize="hasAuthority('text1|${object}|text3')"
sec:authorize="hasAuthority('text1|'+${object}+'|text3')"
sec:authorize="hasAuthority('text1|'& ${object} & '|text3')"

What is the proper syntax




Aucun commentaire:

Enregistrer un commentaire