@Test(expected = AccessDeniedException.class)
public void testCreateOriginWithoutSpecificAddPermission() throws Exception {

  CreateOriginRequest request = new CreateOriginRequest().setOrganization(UUID.randomUUID());
  when(securityContext.getAvailableOrganizationID()).thenReturn(Collections.singleton(request.getOrganization()));
  doThrow(AccessDeniedException.class).when(securityContext).checkPermission(TiFunctionConstants.addThreatIntelOrigin, request.getOrganization());
  delegate.handle(request);
}