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

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

Introduction

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

Prototype

boolean isAuditSuccess();

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());
    }//from   w w w  .  j av a  2  s  . co  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  va2  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());
        }
    }

}