@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
/** * Creates a new cached authorizer. * * @param metricRegistry the application's registry of metrics * @param authorizer the underlying authorizer * @param builder a {@link CaffeineSpec} */ public CachingAuthorizer( final MetricRegistry metricRegistry, final Authorizer<P> authorizer, final Caffeine<Object, Object> builder) { this.underlying = authorizer; this.cacheMisses = metricRegistry.meter(name(authorizer.getClass(), "cache-misses")); this.getsTimer = metricRegistry.timer(name(authorizer.getClass(), "gets")); this.cache = builder.recordStats().build(key -> { cacheMisses.mark(); return underlying.authorize(key.left, key.right); }); }
@Override public boolean isUserInRole(String s) { return authorizer.authorize(principal, s); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public Boolean load(ImmutablePair<P, String> key) throws Exception { cacheMisses.mark(); return underlying.authorize(key.left, key.right); } });
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }
@Override public boolean isUserInRole(String role) { return authorizer.authorize(principal.get(), role); }