We have 2 different options in our acl:
Someone has access using group1 OR group1,...
Or someone has access using role1: group1 AND group2,...

i could solve this problem resolving the roles while logging in of the user.
So the session know which roles (group1 AND group2,...) the user has:

 queryString.append("  AND (unprotected:true ");       
        if (user != null) {
            Collection<String> groups = user.getGroups();
            for (String group : groups) {
                queryString.append(" OR groups:");
                queryString.append("\"" + group + "\"");
            }
            Collection<String> andRoles = user.getAndRoles();            
            if (!andRoles.isEmpty()) {
                for (String role : andRoles) {
                    queryString.append(" OR roles:");
                    queryString.append("\"" + role + "\"");
                }
            }
        }        
        queryString.append(")"); 
-- 
View this message in context: 
http://old.nabble.com/Query-from-User-Session-to-Documents-with-Must-Have-Permissions-tp27743114p27754276.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to