# Daml like entitlements off Daml in a DB

**URL:** <https://forum.canton.network/t/daml-like-entitlements-off-daml-in-a-db/5311>\
**Category:** App Development\
**Created:** [September 29, 2022, 1:32pm UTC](https://forum.canton.network/t/daml-like-entitlements-off-daml-in-a-db/5311 "2022-09-29T13:32:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leonid\_Rozenberg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonid_rozenberg/32/48_2.png) [@Leonid\_Rozenberg](https://forum.canton.network/u/Leonid_Rozenberg)\
**Post date:** [September 29, 2022, 1:32pm UTC](https://forum.canton.network/t/daml-like-entitlements-off-daml-in-a-db/5311/1 "2022-09-29T13:32:29Z")

</div>

If one wanted to build an off ledger ODS to facilitate analytics would y’all recommend to use [Row Security Policies](https://www.postgresql.org/docs/9.5/ddl-rowsecurity.html) on the DB (with interesting implications such as adding users to that DB, that are Daml Party identifiers …) or should one just add columns of `signatories` , `observers` (or just `witnesses` ) and enforce entitlements in client code that access that ODS?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 29, 2022, 8:12pm UTC](https://forum.canton.network/t/daml-like-entitlements-off-daml-in-a-db/5311/2 "2022-09-29T20:12:21Z")

</div>

I recommend to add signatories/observers/witnesses columns and filter based on that. The filter logic is very simple (witnesses.contains(user)) so I wouldn’t be super worried about getting it wrong. On the other hand, I don’t think you want to give end users direct access to your database so provisioning them as database users just doesn’t seem very useful and it has a fair amount of operational overhead.
