Skip to main content

๐Ÿ” Restrict Portal Access by Realm

Hereโ€™s how you can restrict a portal with User security to only users who have been granted access to a certain realm. ๐Ÿฐ

Add a subquery filter:

add-portal-security-subquery.png

Add User GUID as an export, then set up a formula like the following:

user-has-medical-realm.png

In this example, our realm is named Medical Records.

@User-GUID in (select [user] from [realm.user] where [realm] =
(select [id] from [realm] where [name] = 'Medical Records'))

Similarly, to export user realms, try this in a formula:

(select string_agg(r.[name], ', ')
from [realm.user] ru
inner join [realm] r
ย  ย  on r.[id] = ru.[realm]
where ru.[user] = @User-GUID)

Suitcase Example

Try the "Users and Realms" query from this Suitcase: 4e5a7b48-104c-481d-8857-b5ce1148e9e0:rwf.