class MembershipResource {

  @Path("/secrets/{secretId}/groups/{groupId}")
  @Timed @ExceptionMetered
  @PUT
  public Response allowAccess(
      @Auth User user,
      @PathParam("secretId") LongParam secretId,
      @PathParam("groupId") LongParam groupId) {

    logger.info("User '{}' allowing groupId {} access to secretId {}", user, groupId, secretId);

    try {
      aclDAO.findAndAllowAccess(secretId.get(), groupId.get(), auditLog, user.getName(), new HashMap<>());
    } catch (IllegalStateException e) {
      throw new NotFoundException();
    }

    return Response.ok().build();
  }

  @Inject public  MembershipResource(AclDAOFactory aclDAOFactory, AuditLog auditLog);
  @VisibleForTesting  MembershipResource(AclDAO aclDAO, AuditLog auditLog);

}