public boolean fish ( String bait , Permission pond ) { if ( isDebug ( bait ) ) { boolean rv = false ; StringBuilder sb = new StringBuilder ( "Log for " ) ; sb . append ( bait ) ; if ( supports ( bait ) ) { User < PERM > user = getUser ( bait ) ; if ( user == null ) { sb . append ( "\n\tUser is not in Cache" ) ; } else { if ( user . noPerms ( ) ) sb . append ( "\n\tUser has no Perms" ) ; if ( user . permExpired ( ) ) { sb . append ( "\n\tUser's perm expired [" ) ; sb . append ( new Date ( user . permExpires ( ) ) ) ; sb . append ( ' ' ) ; } else { sb . append ( "\n\tUser's perm expires [" ) ; sb . append ( new Date ( user . permExpires ( ) ) ) ; sb . append ( ' ' ) ; } } if ( user == null || ( user . noPerms ( ) && user . permExpired ( ) ) ) { user = loadUser ( bait ) ; sb . append ( "\n\tloadUser called" ) ; } if ( user == null ) { sb . append ( "\n\tUser was not Loaded" ) ; } else if ( user . contains ( pond ) ) { sb . append ( "\n\tUser contains " ) ; sb . append ( pond . getKey ( ) ) ; rv = true ; } else { sb . append ( "\n\tUser does not contain " ) ; sb . append ( pond . getKey ( ) ) ; List < Permission > perms = new ArrayList < Permission > ( ) ; user . copyPermsTo ( perms ) ; for ( Permission p : perms ) { sb . append ( "\n\t\t" ) ; sb . append ( p . getKey ( ) ) ; } } } else { sb . append ( "AAF Lur does not support [" ) ; sb . append ( bait ) ; sb . append ( "]" ) ; } aaf . access . log ( Level . INFO , sb ) ; return rv ; } else { if ( supports ( bait ) ) { User < PERM > user = getUser ( bait ) ; if ( user == null || ( user . noPerms ( ) && user . permExpired ( ) ) ) { user = loadUser ( bait ) ; } return user == null ? false : user . contains ( pond ) ; } return false ; } }
This is where you build AAF CLient Code . Answer the question Is principal bait in the pond