Search in sources :

Example 1 with AclReport

use of org.alfresco.solr.AclReport in project SearchServices by Alfresco.

the class AclTracker method checkAcl.

public AclReport checkAcl(Long aclid) {
    AclReport aclReport = new AclReport();
    aclReport.setAclId(aclid);
    try {
        List<AclReaders> readers = client.getAclReaders(Collections.singletonList(new Acl(0, aclid)));
        aclReport.setExistsInDb(readers.size() == 1);
    } catch (IOException | JSONException | AuthenticationException e) {
        aclReport.setExistsInDb(false);
    }
    // In Index
    return this.infoSrv.checkAclInIndex(aclid, aclReport);
}
Also used : AuthenticationException(org.alfresco.httpclient.AuthenticationException) AclReport(org.alfresco.solr.AclReport) JSONException(org.json.JSONException) Acl(org.alfresco.solr.client.Acl) IOException(java.io.IOException) AclReaders(org.alfresco.solr.client.AclReaders)

Aggregations

IOException (java.io.IOException)1 AuthenticationException (org.alfresco.httpclient.AuthenticationException)1 AclReport (org.alfresco.solr.AclReport)1 Acl (org.alfresco.solr.client.Acl)1 AclReaders (org.alfresco.solr.client.AclReaders)1 JSONException (org.json.JSONException)1