public boolean isAuthorizedForBucket ( AuthContext ctx , Bucket bucket ) { if ( ctx . getUsername ( ) . equals ( adminName ) ) { return ctx . getPassword ( ) . equals ( adminPass ) ; } if ( bucket . getName ( ) . equals ( ctx . getUsername ( ) ) ) { return bucket . getPassword ( ) . equals ( ctx . getPassword ( ) ) ; } return bucket . getPassword ( ) . isEmpty ( ) && ctx . getPassword ( ) . isEmpty ( ) ; }
Determine if the given credentials allow access to the bucket