40fingers / StyleHelper-Sko

Manipulate DNNCMS HTML, JS and CSS in #dnncms
https://www.40fingers.net/Products/DNN-Stylehelper
7 stars 2 forks source link

Change behavior of passed lists for Conditions #25

Open Timo-Breumelhof opened 2 years ago

Timo-Breumelhof commented 2 years ago

Due to the way the MatchString function currently works, it is not possible to test for "This but not that". See documentation for IfRole:

Use: Checks if the current user is in any of the roles you pass. You can pass multiple roles (comma separated). Please note that the test function exits as soon as one of the passed values is found so this works as an OR for multiple values. So IfRole="editor,manager' will be true if a user is a member of one or both roles. IfRole="editor,!manager' will not work as "Editor but not Manager" the second value will not be tested.

In a future version it would better to not use commas, but a boolean separator.

Like:

editor||manager
editor&&manager
editor||!manager

and handle the boolean separators correctly