'Implementing OR conditions in Data Security filters in AAS model

I need to implement data security in AAS tabular model, replicating legacy application implementation.
The legacy application implementation has OR conditions in Data Security filters in AAS model.
Here is the legacy filter

    "Fact - Sales"."lob code " =  ( LOV 1 )
    AND "Fact - Sales"."lob seg code    " =  ( LOV 2 )

    OR "Dim - Table 1"."Location Code" =  ( LOV 3) 

    OR "Fact - Sales"."lob code" =  ( LOV 4 )

The List of values (LOVs) are populated through meta-data tables having mappings of user ids to corresponding data model attributes such as location/LOB codes, translating into dynamic row level security in tabular model i.e. based upon logged in user and the corresponding user's mappings to relevant attributes such as location codes (security meta-data tables), the data filters are applied.

Now, the usual way that I know are that the data filters on multiple tables are joined together (AND condition). However here the requirement is something as mentioned above in the code block needing OR condition and also order of filters seems to be applicable.

Any pointers on how to design these filters in the way as required?

Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source