title: Using RavenDB for a solution with a complex user object permission model
body: <p>We have an application, currently built on a SQL Server database with a "fairly" complicated data permission model.</p>
  
  <p>At the center of our Application is an entity called <code>Record</code>. Whether a user can see a record is based on the user themselves, the workgroup they're part of and the organisation they are part of.</p>
  
  <p>In the diagram below, a logged in <code>User</code> gets to see records to which they're directly assigned, or they're part of a workgroup to which the record is assigned, or they're workgroup is part of an organisation to which the record is assigned.</p>
  
  <p><img src="https://i.stack.imgur.com/Qt3XA.png" alt="enter image description here"></p>
  
  <p>This is a bit of a pain in "SQL + NHibernate" land as there are some messy joins and unions being used to get the results I need. This is just one example of data which is permissioned this way in the application.</p>
  
  <p>I'm just wondering how suitable this type of model is to a NoSQL/RavenDB object hierarchy and if there are any performance considerations / object model re-architecting that might be required.</p>