Example usage for org.springframework.security.acls.model AuditableAccessControlEntry isAuditFailure

List of usage examples for org.springframework.security.acls.model AuditableAccessControlEntry isAuditFailure

Introduction

In this page you can find the example usage for org.springframework.security.acls.model AuditableAccessControlEntry isAuditFailure.

Prototype

boolean isAuditFailure();

Source Link

Usage

From source file:com.cedac.security.acls.mongo.MongoMutableAclService.java

protected DBObject toDBObject(AccessControlEntry entry) {
    BasicDBObject dbo = new BasicDBObject();
    dbo.put(sidFieldName, toDBObject(entry.getSid()));
    dbo.put(maskFieldName, entry.getPermission().getMask());
    dbo.put(grantingFieldName, entry.isGranting());
    if (entry instanceof AuditableAccessControlEntry) {
        AuditableAccessControlEntry ace = (AuditableAccessControlEntry) entry;
        dbo.put(auditSuccessFieldName, ace.isAuditSuccess());
        dbo.put(auditFailureFieldName, ace.isAuditFailure());
    }//w w w  .ja  v a2 s  .c o  m
    return dbo;
}

From source file:ubic.gemma.security.audit.AclAuditLogger.java

@Override
public void logIfNeeded(boolean granted, AccessControlEntry ace) {

    if (!needToLog)
        return;/*from  w  w  w. j  a v a2 s. c o m*/

    if (ace instanceof AuditableAccessControlEntry) {
        AuditableAccessControlEntry auditableAce = (AuditableAccessControlEntry) ace;

        if (granted && auditableAce.isAuditSuccess()) {
            log.info("GRANTED due to ACE: " + ace + " ObjectIdentity=" + ace.getAcl().getObjectIdentity());
        } else if (!granted && auditableAce.isAuditFailure()) {
            log.warn("DENIED due to ACE: " + ace + " ObjectIdentity=" + ace.getAcl().getObjectIdentity());
        }
    }

}