I've done it on a higher level, and based on linq. Instead of starting with session.Query<T>() I start with session.QueryAccessible<T> when I write queries. Collection properties are not filtered when loaded by association in my scenario.
2017-02-07 7:56 GMT+00:00 gg <[email protected]>: > > > On Monday, February 6, 2017 at 11:56:03 PM UTC+1, Ricardo Peres wrote: >> >> You can use filters. They apply to both entities and collections. See it >> here: http://nhibernate.info/doc/nhibernate-reference/filters.html. >> > > Thank you Ricardo. In the previous post I forgot to mention that I'm aware > of filters but they seem to be a bit "restrictive" for what I want to do. > > I need to have a set of detached criteria that can be mixed and applied to > objects based on an xml file that describes permissions. This file is > loaded in a sort of dictionary (ObjectType, permissions) when the > application starts and whenever a query is issued I need to read the > permission associated to the object being queried and apply the correct > detached criteria. This is xml file is configurable and changes for various > reason. I don't want to change the code when I need to modify this kind of > permissions, that's why I think filters won't work. > > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/nhusers. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.
