Hi Vinicius,
First of all, If you want to use data partitions constraints, you must apply the DP either in contacts individually or in roles for contacts.
That said, I tested here and it seems DP constraints don't allow IF/ELSE structures.
You can try using a constraint like (¬A OR B) instead of (IF A THEN B), since both are logically equivalent. It should be something like:
User not in 'L1' group or Created_via == 'WEB'
I didn't test this and I don't know if it works. But a problem I see is: how to represent "User not in 'L1' group" in a constraint? The only constraint regarding groups I know is:
(group.group_list.member IN (@root.id))
that means "The group of a ticket contains the current user". Someone has an idea?
I hope this helps you