You can use jinja in your Cube data models!
Check out this handy cheatsheet to get started using jinja pre-processing syntax in your data models
e.g.
cubes:
- name: customers
title: My customers
sql: >
select *
from public.customers
{% if COMPILE_CONTEXT.securityContext.superUser %}
where 1 = 1
{% else %}
where organisationId in {{ list(COMPILE_CONTEXT.securityContext.orgIds) }}
{% endif %}