Role-based filters in data set definition is definitely useful feature, but currently it is lacking flexibility in defining more dynamic filter condition (similar to row level security filters in semanic model in RPD). The only "dynamic" stuff is ability to reference USER() function, returning User Id of logged user.
So it would be very advisable to allow reference of repository/session variables in filter conditions (or alternatively usage of more dynamic conditions via some form of "subquery" - either Logical SQL or physical SQL - implementation is up to Development). Current status is just first step to make role-based filters really usefull feature. And btw, what is desrcibed in following blog:
https://blogs.oracle.com/analytics/post/oac-data-in-restrict-external-datasets
is just a not very nice workaround for bypassing current limitations of role-based filters.