maxNumberOfItemsToReturn & Authorization

Posts   
 
    
Posts: 67
Joined: 10-Jun-2009
# Posted on: 27-Sep-2009 14:38:02   

I have a web application where I want to display the 25 newest entities, based on a property "created".

To display this list, I fill an entity collection using GetMulti(selectFilter, 25, sortClauses). However, this is when the Authorization Classes come in. In this collection of 25 entities there are some entities which the current user is not allowed to see. So they are filtered out. There are some cases even the current user doesn't see any entities, because he has no access to the first 25 newest entities.

What is the best approach for this? I want to display a list of a maximum of 25 newest entities where the user has access to.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Sep-2009 21:14:24   

You can't do that in the Authorizer logic. So, in the method you retrieve such entities, you have to add a predicate that filter the user (fetch my entities where the user is xxx).

David Elizondo | LLBLGen Support Team
Posts: 67
Joined: 10-Jun-2009
# Posted on: 27-Sep-2009 21:18:48   

I was afraid I might get this answer simple_smile .

I will, thanks for your reply.