code: @PUT
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_JSON)
      @Path("/{namespaceId}/users")
      @Description("Update users allowed to use this namespace.")
      public NamespaceDto updateUsersForNamespace(@Context HttpServletRequest req,
          @PathParam("namespaceId") final BigInteger namespaceId, final Set<String> usernames) {
          PrincipalUser remoteUser = getRemoteUser(req);
  
          if (namespaceId == null || namespaceId.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("Namespace Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
          }
          if (usernames == null) {
              throw new WebApplicationException("Cannot update with null users.", Status.BAD_REQUEST);
          }
  
          Namespace namespace = _namespaceService.findNamespaceByPrimaryKey(namespaceId);
  
          if (namespace == null) {
              throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
          }
          validateResourceAuthorization(req, namespace.getCreatedBy(), remoteUser);
          namespace.setUsers(_getPrincipalUserByUserName(usernames));
          namespace = _namespaceService.updateNamespace(namespace);
          return NamespaceDto.transformToDto(namespace);
      }
docs: Update users allowed to use this namespace.
  
  @param   req          The HTTP request.
  @param   namespaceId  The namespace ID to update.
  @param   usernames    The list of authorized users.
  
  @return  The updated namespace.
  
  @throws  WebApplicationException  If an error occurs.