-
1. Re: Security Rules + EJB-QL + data listing : what is the best way
balazska Apr 14, 2010 8:43 AM (in response to balazska)so, the main scenario is to get 5 entities (query setMaxResult) with the EJB-qL, where the hasPermission(entity,'rule') is ok.
Thanks, for any advice!
-
2. Re: Security Rules + EJB-QL + data listing : what is the best way
shane.bryzak Apr 14, 2010 9:52 AM (in response to balazska)You can use Identity.filterByPermission() to do this.
-
3. Re: Security Rules + EJB-QL + data listing : what is the best way
shane.bryzak Apr 14, 2010 9:56 AM (in response to balazska)Actually after reading your question more closely, I should point out that this will only filter the query results after they've been fetched. Unfortunately this is the only option here, unless we come up with some really powerful magic that can rewrite the query.
-
4. Re: Security Rules + EJB-QL + data listing : what is the best way
balazska Apr 14, 2010 10:06 AM (in response to balazska)thanks for your reply!!!
But, I think it would be a common scenario, so I am at a total loss with this issue. :(
-
5. Re: Security Rules + EJB-QL + data listing : what is the best way
shane.bryzak Apr 14, 2010 10:18 AM (in response to balazska)It most certainly is a common scenario, however there's no easy way to achieve this in a generic fashion. What you could possibly do in your specific case is perform the join manually between the entities in your query and the permission table. It's a little messy, but should produce the result you need.
-
6. Re: Security Rules + EJB-QL + data listing : what is the best way
balazska Apr 14, 2010 11:27 AM (in response to balazska)thanks so much!
How can I get and join the permission table if I just want to use a hasPermission(entity,'rule') expression.
-
7. Re: Security Rules + EJB-QL + data listing : what is the best way
shane.bryzak Apr 14, 2010 1:54 PM (in response to balazska)You can't use the hasPermission() expression, you need to write your query so that it does an inner join to the permission table for the entities in question. I.e. join on the target value, and constrain by the action that you want to check.
-
8. Re: Security Rules + EJB-QL + data listing : what is the best way
balazska Apr 14, 2010 3:45 PM (in response to balazska)Can you write a little code sample, to be clear for me.
thanks.