I study indexing engines, in particular Apache Lucene Solr. We are ready to use it for our searches, but one of the problems solved by our search within the framework is access at the row level.
Solr does not provide write access from the box:
<...> Solr does not apply to security both at the document level and at the communication level.
And in the section on document-level security: http://wiki.apache.org/solr/SolrSecurity#Document_Level_Security
There are several suggestions - either use Manifold CF (which is very undocumented and seems to be in pre-beta testing), or write your own request handler / component (this part is marked as a stub) - I think that a later version alone will have a greater impact on performance.
Therefore, I suppose that not much has been done in this field.
In the recently released version of Solr 4.0, they introduced a union of two indexed objects. Joining may seem like a good idea, as our system also makes a connection to find out if a record is available to the user. The problem here is that sometimes we make an internal connection, and sometimes an external one (depending on optimism (everything that is forbidden) or pessimistic (everything is forbidden only what is explicitly allowed) in the security settings).
To better understand what our structure looks like:
<strong> Documents
DocumentNr | Name ------------------ 1 | Foo 2 | Bar
DocumentRecordAccess
DocumentNr | UserNr | AllowRead | AllowUpdate | AllowDelete ------------------------------------------------------------ 1 | 1 | 1 | 1 | 0
So, for example, the generated query for the parameter "Document parameters in pessimistic mode":
SELECT * FROM Documents AS d INNER JOIN DocumentRecordAccess AS dra ON dra.DocumentNr=d.DocumentNr AND dra.AllowRead=1 AND dra.UserNr=1
This will return only foo, but not the panel. And in the optimistic mode:
SELECT * FROM Documents AS d LEFT JOIN DocumentRecordAccess AS dra ON dra.DocumentNr=d.DocumentNr AND dra.AllowRead=1 AND dra.UserNr=1
Returning both - Foo and Bar.
Returning to my question - maybe someone has already done this and can share their understanding and experience?