The simple solution to access restriction when number of users are small is Access Control Matrix. Here the rows are the users and columns are different types of asset.
In my case, I have a document which I need to serve which have different attributes. So my columns will be different attributes. So now it is simple 2-D matrix.
But I have requirements which also depend on the information inside document. So lets say I have two types of documents, one with X attribute and other without X attribute.
As far as I have got, this will increase the dimension of my matrix to 3-D, where in Z axis I will have two entries, "X Attr Doc", "Without X Attr Doc".
My requirements are such that it also depends upon the information i am serving.
Only Solution I have come up till now is to have a 2-d matrix and in each cell of the matrix have a certain rule.
Here the ClientIDs are different users, and Public, Core, Private, Default are different categories (set of attributes) of which they are granted access or not.
You can see in one cell, the access is granted only if certain condition is met which depends on the document.
Also, I want in future this table to be configurable, for eg, whenever a new client register, we can add one new row. Or we can have new column if we have new category which need to be served.
Is there any better solution? If not, can any one suggest the most performance efficient way to implement it in JAVA. I was thinking of expression language like SPEL, but I have no idea.