@Test public void testHandle_alreadyAuthorized() throws Exception { attributesMap.set(SecurityHandler.AUTHORIZED_KEY, true); underTest.handle(context); verify(securityFacet, never()).ensurePermitted(any()); }
@Nonnull @Override public Response handle(@Nonnull final Context context) throws Exception { SecurityFacet securityFacet = context.getRepository().facet(SecurityFacet.class); if (context.getAttributes().get(AUTHORIZED_KEY) == null) { securityFacet.ensurePermitted(context.getRequest()); context.getAttributes().set(AUTHORIZED_KEY, true); } return context.proceed(); }
SecurityHandler extends ComponentSupport implements org.sonatype.nexus.repository.view.handlers.SecurityHandler { @Nonnull @Override public Response handle(@Nonnull final Context context) throws Exception { SecurityFacet securityFacet = context.getRepository().facet(SecurityFacet.class); if (context.getAttributes().get(AUTHORIZED_KEY) == null) { securityFacet.ensurePermitted(context.getRequest()); context.getAttributes().set(AUTHORIZED_KEY, true); } return context.proceed(); } }
SecurityHandler extends ComponentSupport implements org.sonatype.nexus.repository.view.handlers.SecurityHandler { @Nonnull @Override public Response handle(@Nonnull final Context context) throws Exception { SecurityFacet securityFacet = context.getRepository().facet(SecurityFacet.class); if (context.getAttributes().get(AUTHORIZED_KEY) == null) { securityFacet.ensurePermitted(context.getRequest()); context.getAttributes().set(AUTHORIZED_KEY, true); } return context.proceed(); }  }
SecurityHandler extends ComponentSupport implements org.sonatype.nexus.repository.view.handlers.SecurityHandler { @Nonnull @Override public Response handle(@Nonnull final Context context) throws Exception { SecurityFacet securityFacet = context.getRepository().facet(SecurityFacet.class); if (context.getAttributes().get(AUTHORIZED_KEY) == null) { securityFacet.ensurePermitted(context.getRequest()); context.getAttributes().set(AUTHORIZED_KEY, true); } return context.proceed(); }  @Nonnull @Override Response handle(@Nonnull final Context context); }
SecurityHandler extends ComponentSupport implements org.sonatype.nexus.repository.view.handlers.SecurityHandler { @Nonnull @Override public Response handle(@Nonnull final Context context) throws Exception { SecurityFacet securityFacet = context.getRepository().facet(SecurityFacet.class); if (context.getAttributes().get(AUTHORIZED_KEY) == null) { securityFacet.ensurePermitted(context.getRequest()); context.getAttributes().set(AUTHORIZED_KEY, true); } return context.proceed(); }  @Nonnull @Override Response handle(@Nonnull final Context context);  }